aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-07-15 13:23:54 +0200
committerNikita Popov <npopov@redhat.com>2022-07-18 09:32:08 +0200
commit11079e8820ab58417365c226d39f2615b0bef685 (patch)
treeb706073a29b7ba1d7e4b5a0074a24662dc04804f /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
parent048aaab19420a67c5b4075726233f73b37ed177c (diff)
downloadllvm-11079e8820ab58417365c226d39f2615b0bef685.zip
llvm-11079e8820ab58417365c226d39f2615b0bef685.tar.gz
llvm-11079e8820ab58417365c226d39f2615b0bef685.tar.bz2
[IR] Don't treat callbr as indirect terminator
Callbr is no longer an indirect terminator in the sense that is relevant here (that it's successors cannot be updated). The primary effect of this change is that callbr no longer prevents formation of loop simplify form. I decided to drop the isIndirectTerminator() method entirely and replace it with isa<IndirectBrInst>() checks. I assume this method was added to abstract over indirectbr and callbr, but it never really caught on, and there is nothing left to abstract anymore at this point. Differential Revision: https://reviews.llvm.org/D129849
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopRotationUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index 0f33559..597c88a 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -622,7 +622,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
// We only need to split loop exit edges.
Loop *PredLoop = LI->getLoopFor(ExitPred);
if (!PredLoop || PredLoop->contains(Exit) ||
- ExitPred->getTerminator()->isIndirectTerminator())
+ isa<IndirectBrInst>(ExitPred->getTerminator()))
continue;
SplitLatchEdge |= L->getLoopLatch() == ExitPred;
BasicBlock *ExitSplit = SplitCriticalEdge(