diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-20 20:49:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-20 20:49:25 +0000 |
commit | 911d5b3ace39c8351042bdc211e9ec59f5c08b7f (patch) | |
tree | b4150655dde79fa944f5107f066ddc3e75b0ff0a /llvm/lib/Transforms/Scalar/LoopRotation.cpp | |
parent | a5c57ccf2da8fed28a96f12c3227577c580ea0ad (diff) | |
download | bcm5719-llvm-911d5b3ace39c8351042bdc211e9ec59f5c08b7f.tar.gz bcm5719-llvm-911d5b3ace39c8351042bdc211e9ec59f5c08b7f.zip |
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
llvm-svn: 230058
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopRotation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index 2606805400f..4d123490537 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -535,6 +535,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { 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, CriticalEdgeSplittingOptions(DT, LI).setPreserveLCSSA()); |