diff options
author | Nikita Popov <npopov@redhat.com> | 2022-07-07 09:32:36 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-07-08 09:20:44 +0200 |
commit | 34a5c2bcf266bb5511791803d66304cc58418bdc (patch) | |
tree | 8f02c54f38d918a863ce3800f431af8cd5fc391e /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 9b37d48dd9c26a277c84dd0691173c83616306e2 (diff) | |
download | llvm-34a5c2bcf266bb5511791803d66304cc58418bdc.zip llvm-34a5c2bcf266bb5511791803d66304cc58418bdc.tar.gz llvm-34a5c2bcf266bb5511791803d66304cc58418bdc.tar.bz2 |
[BasicBlockUtils] Allow critical edge splitting with callbr terminators
After D129205, we support SplitBlockPredecessors() for predecessors
with callbr terminators. This means that it is now also safe to
invoke critical edge splitting for an edge coming from a callbr
terminator. Remove checks in various passes that were protecting
against that.
Differential Revision: https://reviews.llvm.org/D129256
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 56bb405..079b2fc 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -769,8 +769,7 @@ llvm::SplitAllCriticalEdges(Function &F, unsigned NumBroken = 0; for (BasicBlock &BB : F) { Instruction *TI = BB.getTerminator(); - if (TI->getNumSuccessors() > 1 && !isa<IndirectBrInst>(TI) && - !isa<CallBrInst>(TI)) + if (TI->getNumSuccessors() > 1 && !isa<IndirectBrInst>(TI)) for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) if (SplitCriticalEdge(TI, i, Options)) ++NumBroken; |