Reapply r166405, teaching tailcallelim to be smarter about nocapture, with a
authorNick Lewycky <nicholas@mxc.ca>
Mon, 22 Oct 2012 03:03:52 +0000 (03:03 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Mon, 22 Oct 2012 03:03:52 +0000 (03:03 +0000)
commit8b67e1e0b9f75236ccf6119b8249c230a309c9de
tree7b52f5c5d44456cb9c6eef4a72879060ebbad7a8
parent60d56d2eea97e67faf97981e5fb9e058131b7514
Reapply r166405, teaching tailcallelim to be smarter about nocapture, with a
very small but very important bugfix:
  bool shouldExplore(Use *U) {
    Value *V = U->get();
    if (isa<CallInst>(V) || isa<InvokeInst>(V))
    [...]
should have read:
  bool shouldExplore(Use *U) {
    Value *V = U->getUser();
    if (isa<CallInst>(V) || isa<InvokeInst>(V))
Fixes PR14143!

llvm-svn: 166407
llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
llvm/test/Transforms/TailCallElim/nocapture.ll