[llvm] 5fbc81a - [JumpThreading] Use isGuaranteedToTransferExecutionToSuccessor() with range (#203918)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 08:17:23 PDT 2026
Author: Nikita Popov
Date: 2026-06-15T15:17:17Z
New Revision: 5fbc81a2f2b00c21e84bb8f450233713acb6edda
URL: https://github.com/llvm/llvm-project/commit/5fbc81a2f2b00c21e84bb8f450233713acb6edda
DIFF: https://github.com/llvm/llvm-project/commit/5fbc81a2f2b00c21e84bb8f450233713acb6edda.diff
LOG: [JumpThreading] Use isGuaranteedToTransferExecutionToSuccessor() with range (#203918)
Use the overload that accepts a range of instructions. This is not NFC
because the scan is now subject to ScanLimit.
Added:
Modified:
llvm/lib/Transforms/Scalar/JumpThreading.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 762d1839a1069..b7a0e3989fdc0 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -1366,9 +1366,9 @@ bool JumpThreadingPass::simplifyPartiallyRedundantLoad(LoadInst *LoadI) {
// overkill.
if (PredsScanned.size() != AvailablePreds.size() &&
!isSafeToSpeculativelyExecute(LoadI))
- for (auto I = LoadBB->begin(); &*I != LoadI; ++I)
- if (!isGuaranteedToTransferExecutionToSuccessor(&*I))
- return false;
+ if (!isGuaranteedToTransferExecutionToSuccessor(LoadBB->begin(),
+ LoadI->getIterator()))
+ return false;
// If there is exactly one predecessor where the value is unavailable, the
// already computed 'OneUnavailablePred' block is it. If it ends in an
More information about the llvm-commits
mailing list