evm_llvm icon indicating copy to clipboard operation
evm_llvm copied to clipboard

[Optimization] Global Stack Allocation

Open lialan opened this issue 5 years ago • 5 comments

Implement the algorithm presented here

lialan avatar Jan 07 '20 18:01 lialan

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.

lialan avatar Jan 15 '20 15:01 lialan

Development happens in branch: https://github.com/etclabscore/evm_llvm/tree/stack_alloc

lialan avatar Jan 15 '20 16:01 lialan

We also need to implement a size limit for each of the stack regions. Because we can only retrieve 16 elements from the stack.

lialan avatar Jan 29 '20 21:01 lialan

Progress so far:

  1. Making unbalanced branch balanced: inserting a POP to make sure each branch has a use of an operand.

  2. Making X-stack the same across branches.

Some bugs are still needs to be fixed.

lialan avatar Apr 27 '20 03:04 lialan

Added some special handling for stackargs. 4dcbdc528b6

lialan avatar May 14 '20 20:05 lialan