cps icon indicating copy to clipboard operation
cps copied to clipboard

optimize locals to the stack

Open disruptek opened this issue 4 years ago • 1 comments

When locals aren't used in remote legs, we don't need to move them to the environment.

disruptek avatar May 28 '21 19:05 disruptek

This one is particularly hard, consider:

proc foo() =
  var s = "string"
  var c = cstring(s)
  noop()
  echo $c

Despite only c is used in the following continuation, we must keep s because c leases s resource.

alaviss avatar Jun 14 '21 00:06 alaviss