diff options
author | Florian Hahn <flo@fhahn.com> | 2025-09-04 11:32:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-04 11:32:33 +0100 |
commit | b400fd115145ccea0b62944e37e74eedc9da223f (patch) | |
tree | 29cbe2f2410c3d2a0b4dd1c7eab1878d679caca0 /llvm/lib/Analysis/Loads.cpp | |
parent | c14052e20b87bc74a031d09fb312723e0751ed0f (diff) | |
download | llvm-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.cpp | 3 |
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) || |