aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir/ir.h
Commit message (Collapse)AuthorAgeFilesLines
* basic CSElemon2026-01-041-0/+3
|
* rega: fix spill copy of i32 -> i64lemon2026-01-041-1/+1
|
* backend: separate instrs for integer/float storelemon2025-12-311-1/+2
|
* avoid GOT relocations in unnecessary instanceslemon2025-12-251-2/+7
| | | | | Also change xcon to have a flagset for symbols (whether it's a function, locally defined; later: thread local, etc).
* ir: arena-backed linked list for uselistslemon2025-12-241-2/+1
| | | | | Is much simpler than the growable buffers, seems to be just as efficient if not a little faster when benchmarked.
* lower alloca as a separate pass before isellemon2025-12-231-0/+4
|
* ir: use BIT macro for regset (1<< is wrong for u64)lemon2025-12-231-0/+2
|
* some static assertions for packed type sizeslemon2025-12-201-0/+2
|
* backend: unify pass memory allocation strategieslemon2025-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.
* backend: general simplification pass skeletonlemon2025-12-201-0/+4
|
* ir: move some filluses() to ir.c, rename optmem.c -> mem2reg.clemon2025-12-191-2/+2
|
* ir: move cls2load to interfacelemon2025-12-181-0/+1
| | | | | There's plenty of code duplication like this around I'm looking to reduce.
* create distinct interned string typelemon2025-12-151-6/+6
| | | | | | | | | | | | | | Interned strings are used pervasively, so it's a good idea to add a layer of type safety to differentiate them from general cstrs and avoid potential bugs from comparing non-interned and interned strings. Not that that's happened so far that I can remember, but it could. I'm 90% sure it's legal to alias `struct {char c;}` pointers with `char` pointers. This specific typedef gives type safety but with a simple one-way `internstr -> const char *` typecast (with `&istr->c`). Converting the other way around is more intentional: a straight up cast `(internstr)cstr` which sticks out as unchecked and probably wrong, or calling the intern(cstr) function, which is the right way.
* fix position independent loads of function symbols.lemon2025-12-131-2/+2
| | | | | | | | For `extern int x[1];`, can use PCREL32 for &x. But for `extern int x(int)`, must use GOTREL, when not being called directly (that's PLT). Therefore the type of an external symbol (actually just whether it denotes a function) matters when deciding what kind of relocation to emit, so keep that information.
* ir: bump MAXINSTRlemon2025-12-101-1/+1
|
* abi: fix aggregate passed by regs 2nd reg offsetlemon2025-12-061-3/+6
| | | | | | | | | It was broken for example `struct { i32 a; f64 b; }` (would try to load/store b from byte offset 4, not 8). Introduce r2off, realize in x86-64 it's always 8; even `struct {i32 a; f32 b;}` gets passed in one (integer) register. But not so in (future) ABIs like RISC-V, I believe there `{i32, f32}` would get passed in 1 integer and 1 float register (r2off = 4).
* add command-line predefined macros (-D, -U)lemon2025-12-061-2/+0
|
* ir.h: tweak mkintrin() definition to work with tinycclemon2025-11-241-1/+1
|
* c: check actual reachability for non-void func may not return valuelemon2025-11-231-0/+1
|
* ir: implement dominator tree computationlemon2025-11-211-0/+2
|
* ir: barebones IR passes checked contractslemon2025-11-211-0/+8
|
* change op names to match 285063eba44lemon2025-11-211-2/+2
|
* rename IR classes to reflect bitsizelemon2025-11-211-7/+7
|
* isel: lower allocas a different way, such that stk address gets materialized ↵lemon2025-11-201-1/+1
| | | | when necesary
* ir: for easier debugging, keep ctype in dats, print as literal when possiblelemon2025-11-201-1/+2
|
* factor type stuff into type.hlemon2025-11-161-0/+14
|
* ir: 'trap' jump; c: __builtin_trap; lex: __has_builtinlemon2025-11-151-1/+2
|
* preeliminary va_list supportlemon2025-11-141-3/+6
|
* implement argument passing in stacklemon2025-11-121-0/+1
|
* fixup! amd64: get rid of xinc/xdec. handle those at emit stagelemon2025-11-091-0/+1
|
* amd64: fix aggregate abi stuff;; ir: fold, peephole optimizing constructorslemon2025-11-051-2/+10
|
* ir bugfixeslemon2025-10-231-0/+1
|
* Organize source files into directorieslemon2025-10-191-0/+280