diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2014-07-23 06:24:49 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2014-07-23 06:24:49 +0000 |
| commit | aba900c2525b6bbc2bb8e294974f0c694cc8c06a (patch) | |
| tree | da4b17a7fafdcfdc9a65b7d914009958d26f69fb /llvm/lib/Transforms | |
| parent | 9386c82d56745579e86ddbe3a37bea6604658c6a (diff) | |
| download | bcm5719-llvm-aba900c2525b6bbc2bb8e294974f0c694cc8c06a.tar.gz bcm5719-llvm-aba900c2525b6bbc2bb8e294974f0c694cc8c06a.zip | |
We may visit a call that uses an alloca multiple times in callUsesLocalStack, sometimes with IsNocapture true and sometimes with IsNocapture false. We accidentally skipped work we needed to do in the IsNocapture=false case if we were called with IsNocapture=true the first time. Fixes PR20405!
llvm-svn: 213726
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp index 05b9892470b..b7580255150 100644 --- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -227,12 +227,10 @@ struct AllocaDerivedValueTracker { } void callUsesLocalStack(CallSite CS, bool IsNocapture) { - // Add it to the list of alloca users. If it's already there, skip further - // processing. - if (!AllocaUsers.insert(CS.getInstruction())) - return; + // Add it to the list of alloca users. + AllocaUsers.insert(CS.getInstruction()); - // If it's nocapture then it can't capture the alloca. + // If it's nocapture then it can't capture this alloca. if (IsNocapture) return; |

