Commit Graph

205 Commits

Author SHA1 Message Date
florian
3db1415a44 * generate correct dfa for subroutines declared as safecall 2022-11-05 16:56:24 +01:00
florian
5670a7543c * properly reset nf_write/nf_modify flags for min/max inline nodes, needed by dead store optimization, resolves #39958
* factored out nutils.node_reset_pass1_write
2022-10-16 22:51:50 +02:00
florian
e024fdc5d7 * cleanup 2022-09-11 22:43:07 +02:00
florian
f2a5bf17fc * improves node complexity calculations 2022-08-26 21:53:58 +02:00
Sven/Sarah Barth
2cc621618a * Delphi-mode calling without parenthesis 2022-05-26 21:43:00 +02:00
florian
e0a1bc6675 + optimize (a and b) or (c and not(b)) into c xor ((c xor a) and b)
+ test

git-svn-id: trunk@48841 -
2021-02-28 18:20:46 +00:00
Jonas Maebe
8ba4c4bcf0 * factored out the creation of loadnodes for special variables/parameters
git-svn-id: trunk@47857 -
2020-12-27 13:18:56 +00:00
Jonas Maebe
5d51a788f7 - revert r47208
* properly fix the internalerror it hid: only replace the local symbols
    migrated to the parentfpstruct right before generating debug information,
    so that internally generated self/result loads during optimisation passes
    don't get confused by the replacement absolutevarsyms (those are normally
    never encountered during optimisation, as regular absolutevarsyms are
    replaced during parsing)

git-svn-id: trunk@47855 -
2020-12-27 13:18:50 +00:00
florian
57dc416d96 + replace appropriate if statements by min/max intrinsics
+ support min/max intrinsic on xtensa

git-svn-id: trunk@47693 -
2020-12-05 22:00:59 +00:00
pierre
bf5b85e5e5 Also look for function name of 'result' is not found in load_result_node
git-svn-id: trunk@47208 -
2020-10-26 14:45:34 +00:00
florian
6fc930a0fc * better complexity calculation of tvecnodes
git-svn-id: trunk@47151 -
2020-10-21 20:46:28 +00:00
Jonas Maebe
a88288bab3 - reverted r46457, accidentally committed (breaks -Oooptcse)
git-svn-id: trunk@46459 -
2020-08-16 12:46:21 +00:00
Jonas Maebe
f26735fc77 * execute the tempinitcode whent the tempcreate node gets processed rather
than when the first temprefnode to it gets processed. Solves the issue
    the foreachnodestatic processes the tempinitcode when seeing the
    tempcreatenode and ignores it when seeing temprefnodes, even though
    it may actually be executed/generated for the temprefnode. It's
    impossible to easily process it for the "correct" temprefnode
    (since there may be multiple temprefnodes for the same tempcreatenode)
   o fixes tarray12 for Darwin/i386 and Linux/i386

git-svn-id: trunk@46457 -
2020-08-16 12:29:31 +00:00
florian
ff34fb1645 * better complexity handling of mul, slash, div, mod
git-svn-id: trunk@46365 -
2020-08-11 18:17:56 +00:00
florian
5da913de0e * float operations can have an exception as a side effect, resolves #37398
git-svn-id: trunk@45824 -
2020-07-21 20:09:39 +00:00
florian
8738b4b47f + might_have_sideeffects checks also if the tempinitcode of a tempref node might have side effects
git-svn-id: trunk@45656 -
2020-06-17 20:33:04 +00:00
florian
b3817f6d92 * slash and divn might have an exception as side effect
git-svn-id: trunk@45652 -
2020-06-14 14:56:48 +00:00
florian
b80d051249 * make fparainit and fparacopyback public
+ process fparainit and fparacopyback in foreachnode
  + print fparainit and fparacopyback
  + do not break if tcallparanode.copy_value_by_ref_para is called multiple times

git-svn-id: trunk@45236 -
2020-05-03 20:37:07 +00:00
florian
e3870079b2 * remove tempref mess for simple inlined functions
git-svn-id: trunk@45217 -
2020-05-02 09:01:35 +00:00
florian
0f06a7205b * do not create full copies of objects when object checking is on, resolves #36863
git-svn-id: trunk@44598 -
2020-04-05 16:26:10 +00:00
florian
424c8a0ac0 * simple record accesses have not side effects
git-svn-id: trunk@44269 -
2020-03-06 16:16:36 +00:00
florian
9819df6fe1 * calculate complexity of an rtti node correctly
git-svn-id: trunk@44261 -
2020-03-03 21:29:52 +00:00
florian
5a87855b06 + might_have_sideeffects takes care of vo_volatile now (it is not exposed yet)
git-svn-id: trunk@44085 -
2020-02-01 20:30:15 +00:00
florian
d479069f8c * might_have_sideeffects takes care of absolute
git-svn-id: trunk@44083 -
2020-02-01 18:00:38 +00:00
Jonas Maebe
e1d9be897a * fixed (harmless) wrong typecast
git-svn-id: trunk@43834 -
2020-01-01 19:19:15 +00:00
florian
f6c16323fa * unified loadnf_load_self_pointer into loadnf_load_addr
+ var parameters are now allowed when doing tail recursion optimziation, resolves #32811

git-svn-id: trunk@43824 -
2019-12-30 22:43:10 +00:00
pierre
7eb0be6127 Fix invalid typecast revealed by -CriotR by changing order of terms in boolean expression
git-svn-id: trunk@43515 -
2019-11-19 22:47:39 +00:00
florian
851accbb4b * cse adjusted
git-svn-id: trunk@43496 -
2019-11-16 14:07:59 +00:00
Jonas Maebe
d23c7980aa * properly perform (or not) range/overflow checking when performing constant
propagation into inlined routines, regardless of the range/overflow
    checking state at the caller site

git-svn-id: trunk@43436 -
2019-11-10 12:00:05 +00:00
florian
b7f58dd8c8 * load nodes for variables in registers do not generated instructions, so their complexity is zero
git-svn-id: trunk@43319 -
2019-10-27 16:53:26 +00:00
florian
31e5b2d9a4 * more precise estimation of subscript node complexity
git-svn-id: trunk@43314 -
2019-10-27 12:40:08 +00:00
florian
e80eee5da5 * generate better code for length(<dyn. type>)=0, resolves #36060
git-svn-id: trunk@43272 -
2019-10-20 13:03:45 +00:00
Jonas Maebe
14a7429e19 * factored out inlinenode check whether it may have a side effect
o also added register assert as having a side-effect (if asserts are
     enabled)

git-svn-id: trunk@42728 -
2019-08-18 15:55:03 +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
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
9630eb7ce9 * synchronised with trunk till r40466
git-svn-id: branches/debug_eh@40467 -
2018-12-04 19:54:31 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
Jonas Maebe
03013cf2e1 * make ttryfinallynode inherit from ttertiary node so it has a "third" node
member. This one will be used by the LLVM descendent to keep a copy of
    the finally code, as it must use a separate version for the code that
    gets executed when an exception is caught and when no exception happens

git-svn-id: branches/debug_eh@40416 -
2018-11-29 21:31:34 +00:00
pierre
044fae62ea Fix bug report 34605 and add corresponding test
git-svn-id: trunk@40377 -
2018-11-27 10:19:36 +00:00
Jonas Maebe
ea69a5b372 * finalizetemps nodes should never be considered equal and have side effects
git-svn-id: trunk@40348 -
2018-11-18 11:07:28 +00:00
Jonas Maebe
3b9f5a5e96 * moved finalization of code generator temps to a node, so it can be getcopy'd
(needed for LLVM, where we need two copies of the finally code: one in case
     an exception occurs, and one in case none is raised)
   o also first finalize parameters and only then code generator temps, since
     in theory the former could create more of the latter

git-svn-id: trunk@40345 -
2018-11-17 22:38:36 +00:00
Jonas Maebe
0cd85d73e4 * ttryfinallynode now inherits from tbinarynode instead of tloopnode, as its
t1 field was always set to tnothingnode

git-svn-id: trunk@40142 -
2018-11-01 13:19:33 +00:00
florian
88f83280dc * correctly take care of short boolean evaluation when rearranging nodes during CSE
git-svn-id: branches/laksen/riscv_new@39803 -
2018-09-25 20:31:03 +00:00
Jeppe Johansen
f828d8700c A subscript can also trigger an exception.
git-svn-id: branches/laksen/riscv_new@39718 -
2018-09-09 14:41:37 +00:00
florian
32a58ba7d1 * might_have_sideeffects gets flags: if mhs_exceptions is passed, nodes which might cause an exception are considered as having a side effect
git-svn-id: branches/laksen/riscv_new@39483 -
2018-07-22 13:11:21 +00:00
florian
c59bd8c29a + calculate loop unrolling using node_count_weighted which takes care of nodes generating no code
* optimized unrolling calculation

git-svn-id: trunk@38688 -
2018-04-04 21:39:46 +00:00
florian
3d514856a4 * improve node complexity calculations for type nodes
git-svn-id: trunk@37151 -
2017-09-06 20:34:56 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00