aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/regalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* rega: fix spill copy of i32 -> i64 lemon2026-01-041-4/+4
|
* backend: separate instrs for integer/float store lemon2025-12-311-3/+3
|
* ir: use BIT macro for regset (1<< is wrong for u64) lemon2025-12-231-6/+6
|
* rega: fix 3ff0bfcb lemon2025-12-211-4/+1
|
* rega: fix infinite loop when compiling infinite loop lemon2025-12-201-1/+4
|
* backend: unify pass memory allocation strategies lemon2025-12-201-1/+1
| | | | | | It was all over the place for temporary data structures used by individual passes. Now there is an arena specifically for that, which is nicer.
* ir/regalloc: struct alloc -> union alloc lemon2025-12-201-16/+15
|
* ir: move cls2load to interface lemon2025-12-181-4/+0
| | | | | There's plenty of code duplication like this around I'm looking to reduce.
* regalloc+emit: get rid of xsave/xrestore hack lemon2025-12-181-49/+63
| | | | | | | Was used for situation where we needed to spill more than 1 temporary and have to use a register that is already used. Instead of push/pop, we can just allocate and set aside specific stack slots for this purpose. Also, reworked linearscan() interval sets to separate FPR/GPR intervals.
* rega: implement stack<->stack swap for parallel moves lemon2025-12-181-29/+34
|
* x86_64: for vararg calls, write to EAX in isel lemon2025-12-181-8/+25
| | | | Also, in regalloc ensure fixed intervals are sorted
* x86-64/emit: implement single-exit-point ret with jump threading lemon2025-12-161-0/+2
|
* bitset: better implementation of bsiter() and stuff lemon2025-12-161-1/+1
| | | | Also changed the type to size_t for portability
* regalloc: fix lifetime construction for nested loops lemon2025-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 <- stack lemon2025-12-131-4/+4
|
* rename arraylength macro -> countof lemon2025-12-111-2/+2
|
* parallel move; implement reg<->stack swp lemon2025-12-101-3/+18
|
* regalloc: optimize a little edge case better lemon2025-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 fixes lemon2025-12-101-1/+1
|
* rega: change assert for spilled callee. it's ok if nspill==1 lemon2025-12-091-1/+1
|
* regalloc: kill dead defs of physical regs lemon2025-12-041-8/+16
|
* regalloc: skip dead phis lemon2025-11-261-1/+4
|
* implement float varargs, and some other fixes lemon2025-11-231-5/+12
|
* make sure indirect function call pointer does not end up in clobber reg lemon2025-11-221-2/+2
|
* regalloc: merge overlapping fixed intervals better lemon2025-11-221-1/+12
|
* ir: barebones IR passes checked contracts lemon2025-11-211-0/+2
|
* change op names to match 285063eba44 lemon2025-11-211-11/+11
|
* rename IR classes to reflect bitsize lemon2025-11-211-5/+5
|
* regalloc: assert nops aren't being used lemon2025-11-211-0/+1
|
* debug output to stdout lemon2025-11-191-2/+2
|
* ir: 'trap' jump; c: __builtin_trap; lex: __has_builtin lemon2025-11-151-2/+2
|
* amd64: fix aggregate abi stuff;; ir: fold, peephole optimizing constructors lemon2025-11-051-6/+13
|
* regalloc: misc lemon2025-11-021-3/+3
|
* rega: fix parallel stack moves lemon2025-11-021-6/+19
|
* rega: fix Ocopy of stk->stk lemon2025-10-261-3/+2
|
* regalloc: fix spill edge case again lemon2025-10-241-1/+5
|
* ir bugfixes lemon2025-10-231-2/+2
|
* regalloc: implement spilling output when 1 input was spilled lemon2025-10-231-5/+21
|
* fix edge case codegen bugs (w/ stack offsets, spilling) lemon2025-10-221-6/+13
|
* always keep volatile loads lemon2025-10-221-0/+4
|
* regalloc fix devirt lemon2025-10-221-3/+5
|
* codegen bugfixes lemon2025-10-191-3/+7
|
* Organize source files into directories lemon2025-10-191-0/+1195