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.<div>

<br></div><div><div>Please review!</div><div><br></div><div>Nick</div><div><br></div></div>