Draco-lang / Compiler

The compiler repository for the Draco programming language.
Apache License 2.0
86 stars 8 forks source link

Eliminate hierarchical operand kinds from IR #281

Closed LPeter1997 closed 1 year ago

LPeter1997 commented 1 year ago

There are some questionable, tree-structured operands creeping into the IR, making it more complex to reason about. These are mainly the array element and member operands. A single store can currently encode something like a[12].foo.bar as an operand, which is making the IR non-atomic, hard to optimize, ...

We should replace these with simply more instructions. Namely, load_field, load_element, store_field, store_element would likely completely eliminate this problem