diff options
author | Nikita Popov <npopov@redhat.com> | 2022-07-15 13:23:54 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-07-18 09:32:08 +0200 |
commit | 11079e8820ab58417365c226d39f2615b0bef685 (patch) | |
tree | b706073a29b7ba1d7e4b5a0074a24662dc04804f /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | |
parent | 048aaab19420a67c5b4075726233f73b37ed177c (diff) | |
download | llvm-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.cpp | 2 |
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( |