mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-01-31 01:35:20 +01:00
[LoopRotate] fix crash encountered with callbr
Summary: While implementing inlining support for callbr (https://bugs.llvm.org/show_bug.cgi?id=40722), I hit a crash in Loop Rotation when trying to build the entire x86 Linux kernel (drivers/char/random.c). This is a small fix up to r353563. Test case is drivers/char/random.c (with callbr's inlined), then ran through creduce, then `opt -opt-bisect-limit=<limit>`, then bugpoint. Thanks to Craig Topper for immediately spotting the fix, and teaching me how to fish. Reviewers: craig.topper, jyknight Reviewed By: craig.topper Subscribers: hiraditya, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D58929 llvm-svn: 355564
This commit is contained in:
@@ -462,9 +462,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
|
||||
for (BasicBlock *ExitPred : ExitPreds) {
|
||||
// We only need to split loop exit edges.
|
||||
Loop *PredLoop = LI->getLoopFor(ExitPred);
|
||||
if (!PredLoop || PredLoop->contains(Exit))
|
||||
continue;
|
||||
if (isa<IndirectBrInst>(ExitPred->getTerminator()))
|
||||
if (!PredLoop || PredLoop->contains(Exit) ||
|
||||
ExitPred->getTerminator()->isIndirectTerminator())
|
||||
continue;
|
||||
SplitLatchEdge |= L->getLoopLatch() == ExitPred;
|
||||
BasicBlock *ExitSplit = SplitCriticalEdge(
|
||||
|
||||
Reference in New Issue
Block a user