aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2025-09-04 11:32:33 +0100
committerGitHub <noreply@github.com>2025-09-04 11:32:33 +0100
commitb400fd115145ccea0b62944e37e74eedc9da223f (patch)
tree29cbe2f2410c3d2a0b4dd1c7eab1878d679caca0 /llvm/lib/Analysis/Loads.cpp
parentc14052e20b87bc74a031d09fb312723e0751ed0f (diff)
downloadllvm-b400fd115145ccea0b62944e37e74eedc9da223f.zip
llvm-b400fd115145ccea0b62944e37e74eedc9da223f.tar.gz
llvm-b400fd115145ccea0b62944e37e74eedc9da223f.tar.bz2
[LAA] Support assumptions with non-constant deref sizes. (#156758)
Update evaluatePtrAddrecAtMaxBTCWillNotWrap to support non-constant sizes in dereferenceable assumptions. Apply loop-guards in a few places needed to reason about expressions involving trip counts of the from (BTC - 1). PR: https://github.com/llvm/llvm-project/pull/156758
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 9586d0e..8fabdbe 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -394,7 +394,8 @@ bool llvm::isDereferenceableAndAlignedInLoop(
Base, Alignment,
[&SE, AccessSizeSCEV, &LoopGuards](const RetainedKnowledge &RK) {
return SE.isKnownPredicate(
- CmpInst::ICMP_ULE, AccessSizeSCEV,
+ CmpInst::ICMP_ULE,
+ SE.applyLoopGuards(AccessSizeSCEV, *LoopGuards),
SE.applyLoopGuards(SE.getSCEV(RK.IRArgValue), *LoopGuards));
},
DL, HeaderFirstNonPHI, AC, &DT) ||