[llvm-branch-commits] [llvm-branch] r214688 - Merging r213726:

Bill Wendling isanbard at gmail.com
Sun Aug 3 21:28:45 PDT 2014


Author: void
Date: Sun Aug  3 23:28:45 2014
New Revision: 214688

URL: http://llvm.org/viewvc/llvm-project?rev=214688&view=rev
Log:
Merging r213726:
------------------------------------------------------------------------
r213726 | nicholas | 2014-07-22 23:24:49 -0700 (Tue, 22 Jul 2014) | 2 lines

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!

------------------------------------------------------------------------

Modified:
    llvm/branches/release_35/   (props changed)
    llvm/branches/release_35/lib/Transforms/Scalar/TailRecursionElimination.cpp
    llvm/branches/release_35/test/Transforms/TailCallElim/basic.ll

Propchange: llvm/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Aug  3 23:28:45 2014
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,213653,213749,213773,213793,213798,213815,213847,213880,213883-213884,213894-213896,213899,213915,214129,214180,214287,214331,214423,214429,214519
+/llvm/trunk:155241,213653,213726,213749,213773,213793,213798,213815,213847,213880,213883-213884,213894-213896,213899,213915,214129,214180,214287,214331,214423,214429,214519

Modified: llvm/branches/release_35/lib/Transforms/Scalar/TailRecursionElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=214688&r1=214687&r2=214688&view=diff
==============================================================================
--- llvm/branches/release_35/lib/Transforms/Scalar/TailRecursionElimination.cpp (original)
+++ llvm/branches/release_35/lib/Transforms/Scalar/TailRecursionElimination.cpp Sun Aug  3 23:28:45 2014
@@ -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;
 

Modified: llvm/branches/release_35/test/Transforms/TailCallElim/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_35/test/Transforms/TailCallElim/basic.ll?rev=214688&r1=214687&r2=214688&view=diff
==============================================================================
--- llvm/branches/release_35/test/Transforms/TailCallElim/basic.ll (original)
+++ llvm/branches/release_35/test/Transforms/TailCallElim/basic.ll Sun Aug  3 23:28:45 2014
@@ -174,3 +174,17 @@ if.end:
 return:
   ret void
 }
+
+declare void @test11_helper1(i8** nocapture, i8*)
+declare void @test11_helper2(i8*)
+define void @test11() {
+; CHECK-LABEL: @test11
+; CHECK-NOT: tail
+  %a = alloca i8*
+  %b = alloca i8
+  call void @test11_helper1(i8** %a, i8* %b)  ; a = &b
+  %c = load i8** %a
+  call void @test11_helper2(i8* %c)
+; CHECK: call void @test11_helper2
+  ret void
+}





More information about the llvm-branch-commits mailing list