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)
commit18b1f4e7692f6a42d8e64d4b7c50a73b2aeacd90
tree07f5ea4186a3c17e3b89385237c7123ed6d0fb78
parentd581b9e61ff782e30cbd097b154213197033db0a
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166407 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/TailRecursionElimination.cpp
test/Transforms/TailCallElim/nocapture.ll