Dmitry Stogov
c3fca224ff
Introduce IR_OP_FLAG_PINNED and IR_BB_HAS_PHI/PI/PARAM/VAR flags
2023-05-05 16:59:22 +03:00
Dmitry Stogov
76f44fa126
Implemented path-exploration based live ranges construction
...
The algorithm is based on "Computing Liveness Sets for SSA-Form Programs",
Florian Brandner, Benoit Boissinot, Alain Darte, Benoit Dupont de Dinechin,
Fabrice Rastello. TR Inria RR-7503, 2011
In comparison to the existing bitset based approach, the new algorithm
is more memory-space efficient and faster on big functions.
2023-05-05 02:01:53 +03:00
Dmitry Stogov
1bbee7b9da
Get rid of ir_live_interval.top
2023-04-28 09:49:12 +03:00
Dmitry Stogov
1749168078
Add ir_insn_len() and ir_insn_inputs_to_len() private helpers
2023-04-21 13:40:55 +03:00
Dmitry Stogov
e01c43a967
Simplify access to nodes with variable inputs count
2023-04-21 12:40:17 +03:00
Dmitry Stogov
44f048ecd9
Reorder fields to reduce the structure size
2023-04-13 21:37:39 +03:00
Dmitry Stogov
2a17b87219
LSRA optimization
2023-04-13 20:56:49 +03:00
Dmitry Stogov
e5c01495da
Use arena to allocate live_intervals and nested data structures
2023-04-13 13:47:16 +03:00
Dmitry Stogov
0b78a322f8
Cache deleted live ranges in ir_ctx.unused_ranges
2023-04-13 11:42:47 +03:00
Dmitry Stogov
d71cbd47d5
Disable LICM across an OSR ENTRY if the value can't be restored at OSR ENTRY point
2023-04-07 16:36:27 +03:00
Dmitry Stogov
efa8a83153
Fix spilling code for arguments passed theought stack and change RA to
...
prefer reusing the same register for splitted intervals
i# utils/
2023-04-06 00:16:49 +03:00
Dmitry Stogov
1e5e9e08ce
Re-implement instruction fusion and live-range construction
2023-04-05 19:20:43 +03:00
Dmitry Stogov
ba0fa44447
Add "const" modifiers
2023-03-28 13:18:12 +03:00
Dmitry Stogov
87dbdcea0d
Add necessary compensation loads for bounded nodes when enter into function through OSR entry-point
2023-03-21 13:45:37 +03:00
Dmitry Stogov
f5b7065b10
Refactor the ENTRY nodes
...
Now all ENTRY nodes have a "fake" input control edge.
Through this edge all of them are dominated by START node.
2023-03-17 09:02:37 +03:00
Dmitry Stogov
9b34731d16
Fix most MSVC compilation warnings
2023-02-28 02:11:09 +03:00
Anatol Belski
964f5a0191
build: MSVC compatibility
...
Signed-off-by: Anatol Belski <ab@php.net>
2023-02-25 00:04:57 +01:00
Dmitry Stogov
fd653528e9
JMP optimization. Lift constant IJMP targets into jmp_table(s).
2023-02-16 22:41:55 +03:00
Dmitry Stogov
9b6b6996c4
Move IR_ALWAYS_INLINE and IR_NEVER_INLINE definition into public ir.h
2023-02-07 23:14:10 +03:00
Dmitry Stogov
677c6cb2cb
Move declaration of some register alloation related macros to public API
...
Use RLOAD.op3 as a flag to avoid spill store
2023-01-30 16:33:57 +03:00
Dmitry Stogov
32ad3d1052
Use inline functions to avoid false positive address sanitaizer warnings
2023-01-20 15:35:02 +03:00
Dmitry Stogov
6a4e239773
Create a sparate pass to remove unreachableble CFG blocks.
...
SCCP pass removes unreachable blocks before CFG construction.
In case of -O0 or -O1 pipeline (without SCCP) it's simpler and faster
to unlink unreachable CFG blocks once, then check for reachability
in almost any compilation pass.
-O2 pipeline (with SCCP) don't need this pass.
2022-11-29 20:02:07 +03:00
Dmitry Stogov
7fd1ccf48b
Eliminte useless checks
2022-11-24 12:23:05 +03:00
Dmitry Stogov
7d07a4ac89
Strength reduction
2022-11-18 14:38:19 +03:00
Dmitry Stogov
00395f0a23
Cleanup: separate ir_phi_input_number() function
2022-11-18 10:11:16 +03:00
Dmitry Stogov
3e3746d5cb
Refactor API that expose target CPU register constraints for register allocator
2022-11-17 23:30:35 +03:00
Jim Huang
af75775bac
Fix build on macOS
...
Corresponding compilation errors:
ir_private.h:11:10: fatal error: 'malloc.h' file not found
ir_gdb.c:162:17: error: implicit declaration of function 'offsetof' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
.shofs = offsetof(ir_gdbjit_obj, sect),
2022-11-12 01:24:33 +08:00
Jim Huang
c4017eab4b
Fix build with GCC prior to 10
2022-11-11 18:05:05 +08:00
Dmitry Stogov
b56f1f5298
Refactor CFG construction algorithm to mark all BB starts in two passes.
...
First we perform a backwad DFS search from "stop" nodes. This pass may
leak some CFG paths ended by infinite loops. To support these paths we
record their possible roots and perform forward DFS search starting from
them.
2022-11-11 10:25:59 +03:00
Dmitry Stogov
47ddea00ac
Use better conditions
2022-11-11 02:56:16 +03:00
Dmitry Stogov
a4b09dd3ce
Improve CFG builder
2022-11-11 00:19:17 +03:00
Dmitry Stogov
78cc14aca9
Fix ir_worklist_clear()
2022-11-10 22:44:29 +03:00
Dmitry Stogov
f484b5d16b
micro-optimization
2022-11-09 13:23:30 +03:00
Dmitry Stogov
6507758530
Use deines instead of magic constants
2022-11-09 13:13:15 +03:00
Dmitry Stogov
8660c3cd8b
micro-optimization
2022-11-09 09:12:16 +03:00
Dmitry Stogov
3535fd2fc4
Fix compilation warnings and signed/unsigned mess
2022-11-08 23:09:35 +03:00
Dmitry Stogov
4c536aae20
Extend SCCP to perform Dead Load Elimination
2022-11-08 15:39:00 +03:00
Dmitry Stogov
cc56f12f13
Add LICENSE and copyright notices
2022-11-08 11:32:46 +03:00
Dmitry Stogov
2dea40bfab
Add API to patch native code
2022-10-26 13:44:44 +03:00
Dmitry Stogov
9f472c1c91
Add support for deoptimization and binding to multiple slots
2022-10-21 17:16:25 +03:00
Dmitry Stogov
1dcfe127e1
Allow save/load "null" references
2022-10-18 15:52:25 +03:00
Dmitry Stogov
ad59556d85
Add support for binding IR nodes to "external" spill slots (e.g. PHP VM stack slots)
2022-09-15 15:26:43 +03:00
Dmitry Stogov
dce017f0ed
Replace calloc() by malloc()
2022-09-15 11:57:01 +03:00
Dmitry Stogov
65f439f198
Turn ir_addrtab into more general ir_hashtab
2022-09-07 00:04:02 +03:00
Dmitry Stogov
3a20a8130c
JMP optimization. Better ENETR block placement.
2022-08-31 14:29:34 +03:00
Dmitry Stogov
32198c00b7
Reimplement JMP optimization
2022-08-30 23:15:20 +03:00
Dmitry Stogov
b0cba142a9
Merge ir_uses_fixed_reg() into ir_get_def_flags() and ir_get_use_flags()
2022-08-12 21:17:19 +03:00
Dmitry Stogov
d55154d998
Introduce ir_bitqueue API
2022-08-12 19:25:10 +03:00
Dmitry Stogov
9ff5d74778
Introduce ir_bitset_pop_first_ex() and ir_bitset_incl_ex() to avoid repatable checks of the first bitset elements.
2022-08-12 18:01:15 +03:00
Dmitry Stogov
3a0fb71282
Improve ir_bitset_pop_first()
2022-08-12 16:09:32 +03:00