[Optimization] Global Stack Allocation
We will split the stack allocation into two parts.
The first part is an analysis. It is something like register allocation, only determines the stack index for a variable.
The second part is the actual allocation, which corresponds to our stackficiation pass.
Development happens in branch: https://github.com/etclabscore/evm_llvm/tree/stack_alloc
We also need to implement a size limit for each of the stack regions. Because we can only retrieve 16 elements from the stack.
Progress so far:
-
Making unbalanced branch balanced: inserting a
POPto make sure each branch has a use of an operand. -
Making X-stack the same across branches.
Some bugs are still needs to be fixed.
Added some special handling for stackargs. 4dcbdc528b6