[llvm-commits] PATCH: stronger tail recursion elimination with nocapture

Nick Lewycky nlewycky at google.com
Wed Oct 3 21:59:23 PDT 2012


Tail recursion elimination has to check whether allocas are escaping. It
currently doesn't bother and just assumes that if mem2reg/sroa hasn't
removed the alloca, then it's an escaping alloca. This patch teaches it to
use CaptureTracking to find calls to functions where the alloca is passed
in through an argument marked nocapture, and safely ignore those. Those
calls can't themselves be marked tail, but they don't block other calls
from being marked tail.

Please review!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f3e2cf25/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tre-nocapture-1.patch
Type: application/octet-stream
Size: 10892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f3e2cf25/attachment.obj>


More information about the llvm-commits mailing list