[llvm-branch-commits] [llvm-branch] r323771 - Merging r323515:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 30 07:25:02 PST 2018


Author: hans
Date: Tue Jan 30 07:25:02 2018
New Revision: 323771

URL: http://llvm.org/viewvc/llvm-project?rev=323771&view=rev
Log:
Merging r323515:
------------------------------------------------------------------------
r323515 | fhahn | 2018-01-26 11:36:50 +0100 (Fri, 26 Jan 2018) | 7 lines

[CallSiteSplitting] Fix infinite loop when recording conditions.

Fix infinite loop when recording conditions by correctly marking basic
blocks as visited.

Fixes https://bugs.llvm.org/show_bug.cgi?id=36105

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

Modified:
    llvm/branches/release_60/   (props changed)
    llvm/branches/release_60/lib/Transforms/Scalar/CallSiteSplitting.cpp
    llvm/branches/release_60/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll

Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 30 07:25:02 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322016,322053,322056,322103,322106,322108,322123,322131,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322900,322904-322905,322973,322993,323034,323190,323307,323331,323355,323369,323371,323384,323469,323582,323671-323672,323710
+/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322016,322053,322056,322103,322106,322108,322123,322131,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322900,322904-322905,322973,322993,323034,323190,323307,323331,323355,323369,323371,323384,323469,323515,323582,323671-323672,323710

Modified: llvm/branches/release_60/lib/Transforms/Scalar/CallSiteSplitting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/Transforms/Scalar/CallSiteSplitting.cpp?rev=323771&r1=323770&r2=323771&view=diff
==============================================================================
--- llvm/branches/release_60/lib/Transforms/Scalar/CallSiteSplitting.cpp (original)
+++ llvm/branches/release_60/lib/Transforms/Scalar/CallSiteSplitting.cpp Tue Jan 30 07:25:02 2018
@@ -142,10 +142,11 @@ recordConditions(const CallSite &CS, Bas
   recordCondition(CS, Pred, CS.getInstruction()->getParent(), Conditions);
   BasicBlock *From = Pred;
   BasicBlock *To = Pred;
-  SmallPtrSet<BasicBlock *, 4> Visited = {From};
+  SmallPtrSet<BasicBlock *, 4> Visited;
   while (!Visited.count(From->getSinglePredecessor()) &&
          (From = From->getSinglePredecessor())) {
     recordCondition(CS, From, To, Conditions);
+    Visited.insert(From);
     To = From;
   }
 }

Modified: llvm/branches/release_60/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll?rev=323771&r1=323770&r2=323771&view=diff
==============================================================================
--- llvm/branches/release_60/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll (original)
+++ llvm/branches/release_60/test/Transforms/CallSiteSplitting/callsite-no-splitting.ll Tue Jan 30 07:25:02 2018
@@ -16,3 +16,27 @@ Tail:
   %r = call i32 @callee(i32* %a, i32 %v, i32 %p)
   ret i32 %r
 }
+
+define void @fn1(i16 %p1) {
+entry:
+  ret void
+}
+
+define void @fn2() {
+  ret void
+
+; Unreachable code below
+
+for.inc:                                          ; preds = %for.inc
+  br i1 undef, label %for.end6, label %for.inc
+
+for.end6:                                         ; preds = %for.inc
+  br i1 undef, label %lor.rhs, label %lor.end
+
+lor.rhs:                                          ; preds = %for.end6
+  br label %lor.end
+
+lor.end:                                          ; preds = %for.end6, %lor.rhs
+  call void @fn1(i16 0)
+  ret void
+}




More information about the llvm-branch-commits mailing list