LLVM’s assumption of R/W memory and registers does not fit with the memory model used by the Cairo VM. We can either take the SSA form and treat the target as an infinite-register machine, or we can emulate R/W memory directly.
For this initial design phase we want to do the bare minimum to get mostly-correct semantics as far as the LLVM IR expects. This task includes designing the assignment model and the semantics of the operations on pointers.
The conventional way to represent R/W memory cells on top of this is to use an array.
Arrays nested in arrays could provide something more like a conventional "memory".
On top of that, we also need to support explicit notions of:
Allocation
Deallocation
Pointer arithmetic
And so on (anything you can do with memory in C, really)
We also need to contend with how wide our pointers are, and other things like that. Until we define our own target this should probably match our target.
Description
LLVM’s assumption of R/W memory and registers does not fit with the memory model used by the Cairo VM. We can either take the SSA form and treat the target as an infinite-register machine, or we can emulate R/W memory directly.
For this initial design phase we want to do the bare minimum to get mostly-correct semantics as far as the LLVM IR expects. This task includes designing the assignment model and the semantics of the operations on pointers.