Commit Graph

673 Commits

Author SHA1 Message Date
J. Gareth "Curious Kit" Moreton
2b7df4237b * nf_pass1_done, nf_error, nf_processing and nf_do_not_execute
have been moved to a new "transientflags" node field that
    isn't stored in PPU files
2024-03-24 18:14:49 +00:00
Jonas Maebe
a76038e1d1 hlcgobj: new getlocal and recordnewsymloc methods
Call hlcg.getlocal instead of tg.getlocal when used for actual parameters/local
variables. Has an extra tsym parameter, which will enable the LLVM backend to
insert debug information.

Call hlcg.recordnewsymloc when the location of a (local/para) symbol changes,
so debug info tracking can be updated (only done for LLVM currently)
2022-06-04 22:26:40 +02:00
florian
5ca2356638 * take care of po_noreturn in more cases
git-svn-id: trunk@47623 -
2020-11-28 16:02:51 +00:00
yury
d34168742e * Fixed r46801 for the case of int64 params with a single paralocation.
git-svn-id: trunk@46802 -
2020-09-08 20:17:50 +00:00
yury
e159c92967 * Do not use stack parameter location for spilling if its size is less than the register size for all CPU targets except x86.
git-svn-id: trunk@46801 -
2020-09-08 18:50:58 +00:00
yury
60c23daa91 * Fixed the stack parameters optimization (r46776) for big endian CPUs.
git-svn-id: trunk@46794 -
2020-09-07 12:54:20 +00:00
yury
c2dc342c55 * Use the initial location of stack parameters as a spilling location if spilling is needed. This leads to the following optimizations:
- no spill temp is allocated;
  - no load of a stack parameter to a spill temp;
  - if a stack parameter is used only once do not preload it to a register. The parameter can be accessed directly in the stack if the target CPU supports this.

git-svn-id: trunk@46776 -
2020-09-05 18:20:18 +00:00
florian
27fbf8c91e * Xtensa: tcpunotnode.second_boolean fixed
git-svn-id: trunk@46672 -
2020-08-23 19:13:19 +00:00
yury
75e5afd45b * When optimization is off always load unused parentfp to a local location to be debugger friendly.
git-svn-id: trunk@46514 -
2020-08-20 16:59:10 +00:00
yury
a258774ba9 * To check the size of a register(s) corresponding to a variable it is needed to use localloc.size instead of def_cgsize(vardef).
git-svn-id: trunk@45834 -
2020-07-23 13:10:50 +00:00
florian
a2303bd899 * fixed copy&paste error of r45658
git-svn-id: trunk@45659 -
2020-06-19 19:55:14 +00:00
florian
2e36783d0e * better check for short boolean evaluation in firstcomplex
git-svn-id: trunk@45658 -
2020-06-18 20:32:55 +00:00
yury
627fcb4354 * Do not use the LOC_VOID location to indicate unused parameters.
* Added the tprocdef.parentfpsym property. Set parentfpsym.varstate to vs_read instead of using the pio_needs_parentfp flag.
* Replaced tcgcallparanode.push_zero_sized_value_para by tparamanager.has_strict_proc_signature.

git-svn-id: trunk@45454 -
2020-05-21 09:36:40 +00:00
florian
15baa272fe * exceptions are side effects which must be considered in boolean expressions
git-svn-id: trunk@45441 -
2020-05-19 20:34:41 +00:00
yury
2808873d1b * Reworked the optimization of unused $parentfp for nested routines.
- Do not remove the $parentfp parameter as was done in the previous optimization approach. Instead when $parentfp is unused to the following:
      - On the caller side: Omit passing the value for $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=false (classic CPU targets). 
          Pass 0/nil as $parentfp for targets where tcgcallparanode.push_zero_sized_value_para=true;
      - On the callee side: Prevent allocation of registers/resources for $parentfp.
  - When possible keep $parentfp in a register.
  - Set the pio_nested_access flag in tprocinfo.set_needs_parentfp() to properly handle deep nesting levels;

git-svn-id: trunk@45436 -
2020-05-19 13:17:47 +00:00
florian
fcf2cd2bea * boolean or/and nodes might be swapped when they have no side effect, in case
of short boolean evaluation, firstcomplex is not called so this does not
    hurt short boolean evaluation

git-svn-id: trunk@45403 -
2020-05-17 17:41:43 +00:00
florian
b352449eac * Xtensa: fix flag handling: B0 is considered as default flags
git-svn-id: trunk@44687 -
2020-04-11 13:18:47 +00:00
florian
3705f95b92 * compilation fixed
git-svn-id: trunk@44545 -
2020-04-03 20:15:27 +00:00
florian
ba3de67f3b + Xtensa: the boolean extension is used as flags
git-svn-id: trunk@44538 -
2020-04-03 20:15:22 +00:00
florian
70a836c4a2 * first part of merging parts of Jeppe's intrinsics patch, mainly r31135
is merged by this commit with a lot of adaptions

git-svn-id: trunk@43949 -
2020-01-14 21:52:39 +00:00
Jonas Maebe
54d3c26e27 * renamed abi_linux386_sysv to abi_i386_dynalignedstack, and also use it
for Darwin-based i386 platforms

git-svn-id: trunk@43650 -
2019-12-05 19:38:01 +00:00
Jonas Maebe
0802edb710 * fix Linux/i386 and Win32 after r43578
git-svn-id: trunk@43583 -
2019-11-25 07:55:57 +00:00
Jonas Maebe
e775ecdc43 * cleaned up safecall support: use a hidden localvarsym instead of result
register hacking
   o this also allowed fixing/adding safecall support for LLVM

git-svn-id: trunk@43578 -
2019-11-24 20:23:22 +00:00
florian
fb91899457 * adapted 16 byte alignment handling on linux: it is now assumed that the callee tries to clear the stack, so in the caller, the stack is re-adjusted
git-svn-id: trunk@43176 -
2019-10-12 21:51:13 +00:00
Jonas Maebe
e56b58c2b0 * factored out checks whether a procdef's symbol needs to be global, and
the generation of the procdef's asmsymbols
   o also removed unnecessary definition of procdef alias symbols for Darwin
     (they are already defined in ncgutil.alloc_proc_symbol)

git-svn-id: trunk@42341 -
2019-07-07 21:33:47 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +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
florian
82e1ce8e4a * if a subroutine has an lsda record, the actions have to cover all code
* cleanup

git-svn-id: branches/debug_eh@41453 -
2019-02-24 20:04:43 +00:00
florian
65cece7657 + mark outmost frame in CFI
git-svn-id: branches/debug_eh@41286 -
2019-02-10 17:59:04 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +00:00
Jonas Maebe
04d295f186 * first step towards supporting 32 bit targets with the LLVM code generator:
use the generic code in more cases when cpuhighleveltarget is defined

git-svn-id: trunk@41133 -
2019-01-29 21:39:09 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
florian
e24449bcfd * if sub nodes of a commutative node contain conditionally executed nodes, these sub nodes might not be swapped
as this might result in some nodes not being executed, like temp. create nodes with init. code, see e.g. issue #34653, resolves #34653

git-svn-id: trunk@40934 -
2019-01-20 12:55:20 +00:00
Jonas Maebe
882d676bc9 * synchronised with trunk till r40635
git-svn-id: branches/debug_eh@40636 -
2018-12-24 22:12:19 +00:00
Jonas Maebe
c9a7afe053 * in constructors, free the temp holding self only after loading the function
result, as self is the function result there (follow up to 40501)

git-svn-id: trunk@40635 -
2018-12-24 22:10:09 +00:00
Jonas Maebe
440026bb25 * synchronised with trunk till r40503
git-svn-id: branches/debug_eh@40504 -
2018-12-08 15:33:36 +00:00
Jonas Maebe
3b7efb5123 * only free the temp holding the function result after we've loaded it into
the function return register (so we won't load from an already freed
    temp once we emit lifetime info for temps on LLVM)

git-svn-id: trunk@40501 -
2018-12-08 15:31:48 +00:00
Jonas Maebe
4cd6f59bc3 * changed create_hlcodegen into a procvar, so that we don't have to insert
hlcgllvm in the uses clause of every unit that calls create_hlcodegen
   o prevents dependency cycles that can cause llvm codegen units to init
     before the cpu variants, which is bad since the llvm versions have to
     override the cpu variants in their init code (+ added checks in the
     init code that they are in fact initialised later)

git-svn-id: branches/debug_eh@40410 -
2018-11-29 21:31:15 +00:00
yury
93d672bf16 * aarch64: Fixed loading of a function result which is returned in 4 32-bit MM registers to 2 64-bit int registers. Bug #30329.
git-svn-id: trunk@39953 -
2018-10-17 11:41:34 +00:00
nickysn
55ecc7feff - removed the check for pocall_oldfpccall from ncgutil.gen_save_used_regs and
gen_restore_used_regs. This is now handled by get_saved_registers_int in
  cpupara.

git-svn-id: trunk@38934 -
2018-05-06 12:41:40 +00:00
Jonas Maebe
d69ad8fa41 * removed temppos field again from parameter locations: they're not allocated
by the temp manager of the current procedure

git-svn-id: trunk@38858 -
2018-04-27 19:18:55 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
florian
a66016026b * handle bitpacked booleans more efficiently
git-svn-id: trunk@38509 -
2018-03-12 22:05:34 +00:00
nickysn
ddba821561 * GetNextReg(), used by 16-bit and 8-bit code generators (i8086 and avr) moved
from cpubase unit to a method in the tcg class. The reason for doing that is
  that this is now a standard part of the 16-bit and 8-bit code generators and
  moving to the tcg class allows doing extra checks (not done yet, but for
  example, in the future, we can keep track of whether there was an extra
  register allocated with getintregister and halt with an internalerror in case
  GetNextReg() is called for registers, which weren't allocated as a part of a
  sequence, therefore catching a certain class of 8-bit and 16-bit code
  generator bugs at compile time, instead of generating wrong code).
- removed GetLastReg() from avr's cpubase unit, because it isn't used for
  anything. It might be added to the tcg class, in case it's ever needed, but
  for now I've left it out.
* GetOffsetReg() and GetOffsetReg64() were also moved to the tcg unit.

git-svn-id: trunk@37180 -
2017-09-11 14:53:06 +00:00
florian
a53d6bd6bd * pass the correct size to a_load_cgparaloc_ref in gen_load_cgpara_loc to avoid to overwrite adjacent data
git-svn-id: trunk@36952 -
2017-08-20 15:22:01 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
svenbarth
d149f260fc - remove no longer needed gen_fpc_dummy()
git-svn-id: trunk@35374 -
2017-01-29 22:40:36 +00:00
Jonas Maebe
a1c0d1a1ff * moved exception handling helpers from ncgutil to ncgflw as they are only
used there (could be turned into protected methods if they are ever needed
    by child classes)

git-svn-id: trunk@35143 -
2016-12-16 22:41:28 +00:00
Jonas Maebe
472b5228fe * changed ncgutil.has_alias_name(pd,s) to a method of tprocdef
git-svn-id: trunk@35085 -
2016-12-09 13:39:28 +00:00