[llvm] 1ce2015 - [NFC] check for UnreachableInst first as it is cheaper compared to getTerminatingDeoptimizeCall
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 28 15:31:44 PDT 2023
Author: AdityaK
Date: 2023-04-28T15:29:44-07:00
New Revision: 1ce2015f7eb0aadfecf70d62d3c520e6d54823ce
URL: https://github.com/llvm/llvm-project/commit/1ce2015f7eb0aadfecf70d62d3c520e6d54823ce
DIFF: https://github.com/llvm/llvm-project/commit/1ce2015f7eb0aadfecf70d62d3c520e6d54823ce.diff
LOG: [NFC] check for UnreachableInst first as it is cheaper compared to getTerminatingDeoptimizeCall
Reviewers: craig.topper, aeubanks, Peter
Differential Revision: https://reviews.llvm.org/D134490
Added:
Modified:
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 7509c482ee32..5a66100ca9ea 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -600,8 +600,8 @@ bool llvm::IsBlockFollowedByDeoptOrUnreachable(const BasicBlock *BB) {
unsigned Depth = 0;
while (BB && Depth++ < MaxDeoptOrUnreachableSuccessorCheckDepth &&
VisitedBlocks.insert(BB).second) {
- if (BB->getTerminatingDeoptimizeCall() ||
- isa<UnreachableInst>(BB->getTerminator()))
+ if (isa<UnreachableInst>(BB->getTerminator()) ||
+ BB->getTerminatingDeoptimizeCall())
return true;
BB = BB->getUniqueSuccessor();
}
More information about the llvm-commits
mailing list