[llvm] [JumpThreading] Use context when checking speculatability (PR #203912)
Nikolas Klauser via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 07:56:35 PDT 2026
================
@@ -1364,18 +1364,28 @@ bool JumpThreadingPass::simplifyPartiallyRedundantLoad(LoadInst *LoadI) {
// farther than to a predecessor, we need to reuse the code from GVN's PRE.
// It requires domination tree analysis, so for this simple case it is an
// overkill.
- if (PredsScanned.size() != AvailablePreds.size() &&
- !isSafeToSpeculativelyExecute(LoadI))
- for (auto I = LoadBB->begin(); &*I != LoadI; ++I)
- if (!isGuaranteedToTransferExecutionToSuccessor(&*I))
- return false;
+ std::optional<bool> GuaranteedToTransfer;
----------------
philnik777 wrote:
Something like that. I don't have a strong opinion on which is easier to read, so feel free to ignore.
https://github.com/llvm/llvm-project/pull/203912
More information about the llvm-commits
mailing list