diff options
author | Florian Hahn <flo@fhahn.com> | 2025-07-14 08:42:15 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2025-07-14 08:45:23 +0100 |
commit | 484417abe1fdf4ac1e027ffd10cc65b0e74e59b1 (patch) | |
tree | 8e5ec0ce631c88c037299f2f4e48543a4d89d0b8 /llvm/lib/Analysis/Loads.cpp | |
parent | a6e1700fa622f75436c3c3ead23b1eefb67e88ea (diff) | |
download | llvm-484417abe1fdf4ac1e027ffd10cc65b0e74e59b1.zip llvm-484417abe1fdf4ac1e027ffd10cc65b0e74e59b1.tar.gz llvm-484417abe1fdf4ac1e027ffd10cc65b0e74e59b1.tar.bz2 |
[Loads] Keep using constant max BTCs for loops w/o computable BTCs.
Follow-up to cad62df49a to preserve the existing behavior for early-exit
loops, to fix vec.stats.ll test failure.
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r-- | llvm/lib/Analysis/Loads.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index 89e42ff..393f264 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -333,6 +333,14 @@ bool llvm::isDereferenceableAndAlignedInLoop( if (isa<SCEVCouldNotCompute>(MaxBECount)) return false; + if (isa<SCEVCouldNotCompute>(BECount)) { + // TODO: Support symbolic max backedge taken counts for loops without + // computable backedge taken counts. + MaxBECount = + Predicates + ? SE.getPredicatedConstantMaxBackedgeTakenCount(L, *Predicates) + : SE.getConstantMaxBackedgeTakenCount(L); + } const auto &[AccessStart, AccessEnd] = getStartAndEndForAccess( L, PtrScev, LI->getType(), BECount, MaxBECount, &SE, nullptr); if (isa<SCEVCouldNotCompute>(AccessStart) || |