aboutsummaryrefslogtreecommitdiffhomepage
path: root/optmem.c
Commit message (Collapse)AuthorAgeFilesLines
* mem2reg: fix deltrivialphis buglemon2025-09-151-7/+14
|
* regalloc: start implementing linear scanlemon2025-09-081-2/+5
|
* mem2reg; stylelemon2023-07-071-7/+12
|
* fix mem2reg ??lemon2023-07-061-10/+43
|
* backend: fix mem2reg & regalloclemon2023-06-261-27/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | they were broken, especially for unstructured control flow. most significant fix is to register allocator for temporaries that are used before the first definition in the source order, e.g.: @1: %x = add %y, 1 b @3 @2 %y = ... b @1 it's legal for %x to use %y there (assuming @2 dominates @1) but from the point of view of the register allocator %y is defined and freed and then used again, which broke things. the fix is to introduce phis for this situation: @1: %y.1 = phi @2 %y %x = add %y.1, 1 b @3 @2 %y = ... b @1 then regalloc phi handling code makes it work
* fix replcuseslemon2023-06-241-0/+1
|
* backend: fix regalloc to work with more complex dataflowlemon2023-06-241-6/+17
| | | | | | | | basically an allocation map at the beginning (in) and end (out) of each block is kept and after the first allocation pass another pass is ran to resolve allocation conflicts between each edge, plus another pass to finish lowering phi functions. also introduced `regset` and plenty of other miscellaneous fixes
* change RMORE -> RADDR; use RXXX (RNONE) for special args,also undeflemon2023-06-221-3/+3
|
* misc fixlemon2023-06-221-13/+10
|
* mem2reg: implement ssa construction; this breaks regalloc right nowlemon2023-06-211-29/+149
|
* add basic mem2reglemon2023-06-201-0/+99
promotes uniform stack slots to temporaries currently only for immutable variables, next thing to implement is ssa construction