[llvm] [LAA] Prepare to handle diff type sizes v2 (PR #161238)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 07:14:35 PDT 2025
================
@@ -2108,19 +2106,41 @@ MemoryDepChecker::getDependenceDistanceStrideAndSize(
if (StrideAScaled == StrideBScaled)
CommonStride = StrideAScaled;
- // TODO: Historically, we didn't retry with runtime checks when (unscaled)
- // strides were different but there is no inherent reason to.
- if (!isa<SCEVConstant>(Dist))
- ShouldRetryWithRuntimeChecks |= StrideAPtrInt == StrideBPtrInt;
-
// If distance is a SCEVCouldNotCompute, return Unknown immediately.
if (isa<SCEVCouldNotCompute>(Dist)) {
LLVM_DEBUG(dbgs() << "LAA: Uncomputable distance.\n");
return Dependence::Unknown;
}
+ if (!isa<SCEVConstant>(Dist)) {
+ if (!LoopGuards)
+ LoopGuards.emplace(
+ ScalarEvolution::LoopGuards::collect(InnermostLoop, SE));
+ Dist = SE.applyLoopGuards(Dist, *LoopGuards);
----------------
artagnon wrote:
Highly unintuitive, but it looks like there was a compile-time [improvement](https://llvm-compile-time-tracker.com/compare.php?from=ce70773cff2ab6b5d9b8d7a97ee62c75762a51d2&to=f4c295d2432ba2ce6d91650d4c1bee01b621146d&stat=instructions%3Au)?
https://github.com/llvm/llvm-project/pull/161238
More information about the llvm-commits
mailing list