Commit Graph

141 Commits

Author SHA1 Message Date
pierre
04ebdf8df8 Fix compilation for x86_64 llvm variant
git-svn-id: trunk@49477 -
2021-06-05 06:47:46 +00:00
pierre
aadcb00977 Add -march option to clang call for llvm target
git-svn-id: trunk@49475 -
2021-06-04 21:14:34 +00:00
pierre
96f2e683e7 Also accept s80bit real constants when FPC_SOFT_FPUX80 macro is defined
git-svn-id: trunk@47557 -
2020-11-24 15:31:26 +00:00
Jonas Maebe
080d8c28f7 * LLVM 11.0 support
git-svn-id: trunk@47121 -
2020-10-17 14:59:04 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
yury
6e777d8967 * ait_comment,ait_regalloc,ait_tempalloc,ait_varloc instructions produce only comments in the external assembler output. Moved handling of these instructions to TExternalAssembler.WriteComments().
This eliminates code duplication and improves maintainability.

git-svn-id: trunk@46550 -
2020-08-22 19:53:39 +00:00
yury
5ec489c018 * ait_varloc instructions are handled and removed by Trgobj.translate_registers() and never left for an assembler.
git-svn-id: trunk@46541 -
2020-08-22 10:58:21 +00:00
Jonas Maebe
a5bad32b7c - removed no longer used -target $TARGET parameter (triplet is used instead)
git-svn-id: trunk@45853 -
2020-07-25 16:11:54 +00:00
Jonas Maebe
eb7ba1690e * mark all external assemblers using an LLVM tool using af_llvm
+ added support for constructing target triplets
  * pass "-target triplet" when using an LLVM assembler
   o removed no longer needed $DARWINVERSION and $ARCH parameters
  * consistently use as_clang_gas when clang is used to assembler GAS-style
    assembly, and rename as_llcm_clang to as_clang_llvm (for consistency)
  * support pipe assembling when using clang on *nix in all cases

git-svn-id: trunk@45807 -
2020-07-19 14:30:35 +00:00
nickysn
3d81dd0b00 * ReplaceForbiddenAsmSymbolChars renamed ApplyAsmSymbolRestrictions, because now it also applies the
label length limit

git-svn-id: branches/z80@45085 -
2020-04-26 10:42:07 +00:00
nickysn
a8fe46c0f5 + introduced labelmaxlen in tasminfo and added code in ReplaceForbiddenAsmSymbolChars that limits the
output label to that length

git-svn-id: branches/z80@45066 -
2020-04-25 12:59:25 +00:00
Jonas Maebe
79974a9671 + -XlS<x> option to specify a suffix for externally called LLVM utilities,
e.g. -XlS-7 to call clang-7 instead of clang)
  * IMPORTANT: changed the -CL llvm code generation options to -Cl, for
    consistency with the new -Xl option (-XL was already taken)

git-svn-id: trunk@44436 -
2020-03-30 19:58:49 +00:00
Jonas Maebe
254b85c352 + new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
2020-01-29 22:21:17 +00:00
Jonas Maebe
b355ba3d39 * record whether a function uses fastmath, and define the function as
strictfp if it doesn't (so LLVM doesn't perform transformations that can
    change the fp/exception behaviour)

git-svn-id: trunk@43818 -
2019-12-30 15:05:06 +00:00
Jonas Maebe
9bd33f7a45 + support for LLVM metadata constant string parameters
o they are implemented as a new metadata register class, whereby the
     subregister indicates the metadata type (currently always a string)
     and the superregister is an index in the metadata array (which
     contains the strings). LLVM metadata can only be passed as parameters
     to intrinsics in bitcode, so moves of metadata into other registers
     triggers internal errors and when moving them into parameters, we
     replace the parameter's register with the metadata register (and look
     up the corresponding string when writing out the bitcode)

git-svn-id: trunk@43816 -
2019-12-30 15:04:57 +00:00
Jonas Maebe
c477816100 - removed LLVM support for clang < 7.0 and Xcode < 10.0: those versions
contain various bugs and can't even complete "make all", so there is no
    point in keeping them
   o changed default LLVM target version to 7.0

git-svn-id: trunk@43682 -
2019-12-14 14:59:05 +00:00
Jonas Maebe
9678542ba6 + add "thunk" attribute for stubs/thunks and emit it for LLVM
- also removed wrong "noreturn" attribute for interface thunks generated
     for high level code generator targets

git-svn-id: trunk@43018 -
2019-09-15 20:43:12 +00:00
Jonas Maebe
dcf4e4cb2c * support taking the address of labels defined in assembler blocks in the
LLVM code genrator (for the rtti unit's thunk hacking)

git-svn-id: trunk@42969 -
2019-09-09 18:33:33 +00:00
Jonas Maebe
3f2578a3e3 * don't quote LLVM calling convention name (that will cause it to be ignored)
o fixes tasm10a and tx64ccnv.ll with LLVM

git-svn-id: branches/debug_eh@42193 -
2019-06-08 17:11:20 +00:00
Jonas Maebe
9f18cbf5d6 * support writing aggregate LLVM constants that are not packed
git-svn-id: branches/debug_eh@42107 -
2019-05-19 19:26:55 +00:00
Jonas Maebe
d74b0843df * set null-pointer-is-valid attribute on functions, so that LLVM does not
optimise provable accesses to null as undefined behaviour (requires
    LLVM/Clang 7.0 or later)

git-svn-id: branches/debug_eh@42055 -
2019-05-12 21:09:44 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
3fa6838815 * basic llvm metadata support
git-svn-id: branches/debug_eh@41978 -
2019-05-02 19:45:26 +00:00
Jonas Maebe
fc60ec2ea4 + support for LLVM LTO: compile units with -CLflto -> when compiling a main
program/library also with -Clflto, all units compiled with that option
    will be linked using their bitcode files and LTO
   o compiling with -CLflto will compile all units twice: once for normal
     (static or smart) linking, and once for LTO. So the result can be
     used both with and without LTO.

git-svn-id: branches/debug_eh@41910 -
2019-04-20 18:56:11 +00:00
Jonas Maebe
810d0ab2fe * use $DARWINVERSION functionality to pass Darwin/iOS version to clang when
assembling llvm bitcode

git-svn-id: branches/debug_eh@41909 -
2019-04-20 18:56:07 +00:00
Jonas Maebe
fcde89cb26 * support forcing to write the parameter alignment for parameters for LLVM,
even when it's the same as the stack alignment (it can also refer to the
    alignment of the data pointed to by pointer parameters)

git-svn-id: branches/debug_eh@41729 -
2019-03-17 15:28:27 +00:00
Jonas Maebe
16cde0da15 * create LLVM TAsmCFI wrapper that calls through to the original TASmCFI for
pure assembler routines and for generating the CFI tables, and does nothing
    for LLVM-handled routines (LLVM takes care of the CFI there)

git-svn-id: branches/debug_eh@41580 -
2019-03-03 17:15:09 +00:00
Jonas Maebe
a079e5fa80 * synchronised with trunk till r41449
git-svn-id: branches/debug_eh@41450 -
2019-02-24 20:01:53 +00:00
Jonas Maebe
6071263469 * use ` instead of ^ as replacement character in LLVM asmnodes, as ^ can
appear in ARM inline assembly

git-svn-id: trunk@41446 -
2019-02-24 19:58:54 +00:00
Jonas Maebe
af098474f4 * keep track of the alignment requirements of parameters with LLVM, and emit
them when they are different from the default

git-svn-id: branches/debug_eh@41216 -
2019-02-03 21:10:14 +00:00
Jonas Maebe
8eb07ed7b1 * add support for custom calling conventions to LLVM function declarations
git-svn-id: branches/debug_eh@41211 -
2019-02-03 21:09:58 +00:00
Jonas Maebe
9d07e4948f * fix compilation of ARM compiler for LLVM
git-svn-id: branches/debug_eh@41210 -
2019-02-03 21:09:54 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
Jonas Maebe
31c047adf8 * synchronised with trunk till r40605
git-svn-id: branches/debug_eh@40606 -
2018-12-21 20:58:16 +00:00
Jonas Maebe
3b4011760a * cleaned up blockaddress instruction (add type rather than hardcoding it
in the assembler writer)
  * fixed taking the address of a label in a typed const for llvm (fixes
    tbs/tb0468a)

git-svn-id: trunk@40599 -
2018-12-20 21:22:44 +00:00
Jonas Maebe
f26ac9026e * enable LLVM support Linux/AArch64
o also put the regular function result before the partfpstruct parameter

git-svn-id: branches/debug_eh@40577 -
2018-12-16 20:46:44 +00:00
Jonas Maebe
cec839ab30 - removed the -(m)stack-alignment parameter, as it prevents stack-realignment
by llc (so avx code crashes on targets wich 16 byte stack alignment --
    which is all of them)

git-svn-id: branches/debug_eh@40445 -
2018-12-01 23:08:48 +00:00
Jonas Maebe
eb742bcacc * pass on the value of -CfXXX to llc/clang for x86-64
git-svn-id: branches/debug_eh@40438 -
2018-12-01 20:30:46 +00:00
Jonas Maebe
85702dd263 + added support for clang as an assembler for llvm IR
* adapted string used for macOS/iOS version in triple in llvm IR files to
    what clang expects (always a single digit patch version)

git-svn-id: branches/debug_eh@40431 -
2018-12-01 20:30:24 +00:00
Jonas Maebe
645a4da831 - removed "-enable-fp-mad" llc option, as it's not supported for all versions
git-svn-id: branches/debug_eh@40420 -
2018-11-29 21:50:18 +00:00
Jonas Maebe
fceb34dbd5 * converted tllvmpara contents from tlocation to toper, so we can also
store tai in them
  + support for direct symbol parameters to llvm routines (without first
    loading them into register)
   o needed to pass such symbols to llvm intrinsics

git-svn-id: branches/debug_eh@40414 -
2018-11-29 21:31:27 +00:00
Jonas Maebe
ce7579bd50 + added "cleanup" landing pad opcode
git-svn-id: branches/debug_eh@40411 -
2018-11-29 21:31:18 +00:00
Jonas Maebe
077d7e8551 * fixed handling of LLVM invoke instruction in the assembler writer and
type inference

git-svn-id: branches/debug_eh@40403 -
2018-11-29 21:30:53 +00:00
Jonas Maebe
5b8f7224af * set the dummy exception handling personality function for functions using
exceptions for LLVM (except on Windows targets, since they (will) use
    their own kind of exception handling)
   o ensure we generate an external function symbol definition for such
     personality functions on LLVM

git-svn-id: branches/debug_eh@40402 -
2018-11-29 21:30:49 +00:00
Jonas Maebe
4b9179636b + support for creating and writing LLVM landingpad instructions
git-svn-id: trunk@35161 -
2016-12-18 13:57:42 +00:00
Jonas Maebe
28e5636daa + support for LLVM nil assembler symbols in instructions (write as "null")
+ support for LLVM nil tai operands (will be used for terminating a daisy
    chain of catch/filter clauses of landingpads): don't try to write it

git-svn-id: trunk@35160 -
2016-12-18 13:57:39 +00:00
Jonas Maebe
876e5eab56 * fixed "smart linking" parameters to llc
git-svn-id: trunk@35044 -
2016-12-02 17:45:12 +00:00
Jonas Maebe
02e4a27a35 * print internalerrors in case we still encounter stray constants not part of
a typed constants
  * don't print superfluous newlines in typed constant definitions

git-svn-id: trunk@35042 -
2016-12-02 12:33:09 +00:00