ControlCplusControlV / Scribe

Minimal Yul Transpilation to the Miden VM
GNU General Public License v3.0
51 stars 4 forks source link

Before expensive loops, push stack vars to memory #52

Open ControlCplusControlV opened 1 year ago

ControlCplusControlV commented 1 year ago

Before expensive loops, push stack vars to memory

Instead of trying to fix the stack at the end of every iteration, to be the same as before, we could just shift everything to memory when a loop is expensive enough. This wouldn't make sense for branches that run once like an if statement or switch, but for loops should probably always do this, unless w/ the dynamic programming thing above we can find a stack order that would eliminate the need to re-order the stack after every loop.