Commit Graph

130 Commits

Author SHA1 Message Date
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
Jonas Maebe
97d6f17cc8 + add support for marking an LLVM definition as using "appending" linkage
git-svn-id: trunk@35039 -
2016-12-02 12:32:58 +00:00
Jonas Maebe
d328d7d95d * don't write an alignment for symbols in internal llvm sections (sections
whose name starts with 'llvm.')

git-svn-id: trunk@35038 -
2016-12-02 12:32:54 +00:00
Jonas Maebe
d99d18e258 - removed useless empty asmwrite statement
git-svn-id: trunk@35037 -
2016-12-02 12:32:51 +00:00
Jonas Maebe
26f9dabf56 * write the volatile flag for LLVM load/store operations if set
git-svn-id: trunk@35004 -
2016-11-27 21:44:32 +00:00
Jonas Maebe
4d951780d1 + support for LLVM 3.8 and LLVM 3.9 IR to the llvm assembler writer
git-svn-id: trunk@35003 -
2016-11-27 21:44:29 +00:00
Jonas Maebe
ef90b46e52 * comment fix
git-svn-id: trunk@34958 -
2016-11-24 19:47:48 +00:00
Jonas Maebe
3b7d9447ae * blockaddress creates a constant operand for another opcode, it's not an
independent operation
   o additionally, it does not take a "label" qualifier for its label argument

git-svn-id: trunk@34944 -
2016-11-21 07:39:05 +00:00
Jonas Maebe
e1e3ad15f0 * escape all occurrences of '$' in function-level inline assembly
o temporarily encode the uses of '$' for references to function-level inline
     assembly arguments as '^', because those have to remain/become a single
     '$'

git-svn-id: trunk@34898 -
2016-11-13 22:10:00 +00:00
Jonas Maebe
43e599d6be * fixed function-level inline assembly constraints in case there are no
parameters

git-svn-id: trunk@34897 -
2016-11-13 22:09:57 +00:00
Jonas Maebe
c4ae040258 + support for writing LLVM function-level inline assembly blocks
git-svn-id: trunk@34891 -
2016-11-13 16:06:29 +00:00
Jonas Maebe
1c23218375 * pass the parameter list directly to getparas()
git-svn-id: trunk@34888 -
2016-11-13 16:06:20 +00:00