aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/regalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* regalloc: fix lifetime construction for nested loopslemon2025-12-151-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, given something like ``` 1 a = ... 2 loop { // outer 3 b = do something with a 4 loop { // inner 5 ... 6 if (b < 0) 7 break 'inner; 8 if (b == 0) 9 return; 10 ... 11 } 12 } ``` Regalloc thought outer goes from 2..6, because 6 is the last place where flow jumps directly back to 2. So `a` would have the lifetime [1,7). However if neither the break nor return are taken, the inner loop repeats and then control could flow back to 7 -> 3. But now the physical location for `a` might have been clobbered between 8..10, which is wrong. This fixes that by making sure the outer loop is considered to span 2..10. The way I went about it might not be the best way of doing it. I'm not 100% certain that it's fully correct and will always find the correct loopend, either. It's surprising it took this long to hit this edge case.
* regalloc: fixbug with phi move of stack <- stacklemon2025-12-131-4/+4
|
* rename arraylength macro -> countoflemon2025-12-111-2/+2
|
* parallel move; implement reg<->stack swplemon2025-12-101-3/+18
|
* regalloc: optimize a little edge case betterlemon2025-12-101-4/+6
| | | | | | | | | | | | With two-address instructions one needs to make sure the dst doesn't get allocated to the same reg as the right-hand operand: %r = mul %x, %y ; %y cannot be %r Except, if the operands are the same %r = mul %x, %x ; if %x is dead after this instr, it's fine to allocate %r to the same reg
* misc fixeslemon2025-12-101-1/+1
|
* rega: change assert for spilled callee. it's ok if nspill==1lemon2025-12-091-1/+1
|
* regalloc: kill dead defs of physical regslemon2025-12-041-8/+16
|
* regalloc: skip dead phislemon2025-11-261-1/+4
|
* implement float varargs, and some other fixeslemon2025-11-231-5/+12
|
* make sure indirect function call pointer does not end up in clobber reglemon2025-11-221-2/+2
|
* regalloc: merge overlapping fixed intervals betterlemon2025-11-221-1/+12
|
* ir: barebones IR passes checked contractslemon2025-11-211-0/+2
|
* change op names to match 285063eba44lemon2025-11-211-11/+11
|
* rename IR classes to reflect bitsizelemon2025-11-211-5/+5
|
* regalloc: assert nops aren't being usedlemon2025-11-211-0/+1
|
* debug output to stdoutlemon2025-11-191-2/+2
|
* ir: 'trap' jump; c: __builtin_trap; lex: __has_builtinlemon2025-11-151-2/+2
|
* amd64: fix aggregate abi stuff;; ir: fold, peephole optimizing constructorslemon2025-11-051-6/+13
|
* regalloc: misclemon2025-11-021-3/+3
|
* rega: fix parallel stack moveslemon2025-11-021-6/+19
|
* rega: fix Ocopy of stk->stklemon2025-10-261-3/+2
|
* regalloc: fix spill edge case againlemon2025-10-241-1/+5
|
* ir bugfixeslemon2025-10-231-2/+2
|
* regalloc: implement spilling output when 1 input was spilledlemon2025-10-231-5/+21
|
* fix edge case codegen bugs (w/ stack offsets, spilling)lemon2025-10-221-6/+13
|
* always keep volatile loadslemon2025-10-221-0/+4
|
* regalloc fix devirtlemon2025-10-221-3/+5
|
* codegen bugfixeslemon2025-10-191-3/+7
|
* Organize source files into directorieslemon2025-10-191-0/+1195