[llvm-branch-commits] [llvm-branch] r231698 - Merging r230058 by d0k:
Joerg Sonnenberger
joerg at bec.de
Mon Mar 9 13:26:36 PDT 2015
Author: joerg
Date: Mon Mar 9 15:26:36 2015
New Revision: 231698
URL: http://llvm.org/viewvc/llvm-project?rev=231698&view=rev
Log:
Merging r230058 by d0k:
LoopRotate: When reconstructing loop simplify form don't split edges
from indirectbrs.
Yet another chapter in the endless story. While this looks like we leave
the loop in a non-canonical state this replicates the logic in
LoopSimplify so it doesn't diverge from the canonical form in any way.
PR21968
Modified:
llvm/branches/release_36/ (props changed)
llvm/branches/release_36/lib/Transforms/Scalar/LoopRotation.cpp
llvm/branches/release_36/test/Transforms/LoopRotate/crash.ll
Propchange: llvm/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 9 15:26:36 2015
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731,229911
+/llvm/trunk:155241,226023,226029,226044,226046,226048,226058,226075,226170-226171,226182,226473,226588,226616,226664,226708,226711,226755,226791,226808-226809,227005,227085,227250,227260-227261,227290,227294,227299,227319,227339,227491,227584,227603,227628,227670,227809,227815,227903,227934,227972,227983,228049,228129,228168,228331,228411,228444,228490,228500,228507,228518,228525,228565,228656,228760-228761,228793,228842,228899,228957,228969,228979,229029,229343,229351-229352,229421,229495,229529,229731,229911,230058
Modified: llvm/branches/release_36/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/lib/Transforms/Scalar/LoopRotation.cpp?rev=231698&r1=231697&r2=231698&view=diff
==============================================================================
--- llvm/branches/release_36/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/branches/release_36/lib/Transforms/Scalar/LoopRotation.cpp Mon Mar 9 15:26:36 2015
@@ -535,6 +535,8 @@ bool LoopRotate::rotateLoop(Loop *L, boo
Loop *PredLoop = LI->getLoopFor(*PI);
if (!PredLoop || PredLoop->contains(Exit))
continue;
+ if (isa<IndirectBrInst>((*PI)->getTerminator()))
+ continue;
SplitLatchEdge |= L->getLoopLatch() == *PI;
BasicBlock *ExitSplit = SplitCriticalEdge(*PI, Exit, this);
ExitSplit->moveBefore(Exit);
Modified: llvm/branches/release_36/test/Transforms/LoopRotate/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_36/test/Transforms/LoopRotate/crash.ll?rev=231698&r1=231697&r2=231698&view=diff
==============================================================================
--- llvm/branches/release_36/test/Transforms/LoopRotate/crash.ll (original)
+++ llvm/branches/release_36/test/Transforms/LoopRotate/crash.ll Mon Mar 9 15:26:36 2015
@@ -153,3 +153,21 @@ entry:
"5": ; preds = %"3", %entry
ret void
}
+
+; PR21968
+define void @test8(i1 %C, i8* %P) #0 {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ br i1 %C, label %l_bad, label %for.body
+
+for.body: ; preds = %for.cond
+ indirectbr i8* %P, [label %for.inc, label %l_bad]
+
+for.inc: ; preds = %for.body
+ br label %for.cond
+
+l_bad: ; preds = %for.body, %for.cond
+ ret void
+}
More information about the llvm-branch-commits
mailing list