[llvm] [LAA] Prepare to handle diff type sizes v2 (PR #161238)
Igor Kirillov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 03:14:50 PDT 2025
================
@@ -2175,32 +2194,22 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
uint64_t ConstDist =
match(Dist, m_scev_APInt(APDist)) ? APDist->abs().getZExtValue() : 0;
- // Attempt to prove strided accesses independent.
- if (APDist) {
- // If the distance between accesses and their strides are known constants,
- // check whether the accesses interlace each other.
- if (ConstDist > 0 && CommonStride && CommonStride > 1 && HasSameSize &&
- areStridedAccessesIndependent(ConstDist, *CommonStride, TypeByteSize)) {
- LLVM_DEBUG(dbgs() << "LAA: Strided accesses are independent\n");
- return Dependence::NoDep;
- }
- } else {
- if (!LoopGuards)
- LoopGuards.emplace(
- ScalarEvolution::LoopGuards::collect(InnermostLoop, SE));
- Dist = SE.applyLoopGuards(Dist, *LoopGuards);
+ // Attempt to prove strided accesses independent. If the distance between
+ // accesses and their strides are known constants, check whether the accesses
+ // interlace each other.
+ if (ConstDist && CommonStride && CommonStride > 1 && HasSameSize &&
+ areStridedAccessesIndependent(ConstDist, *CommonStride,
+ TypeByteSize.first)) {
----------------
igogo-x86 wrote:
We only use TypeByteSize.first (source size) everywhere. This is only safe because HasSameSize guards these
paths. May be better to choose the correct size now per use so mixed-size
cases work without relying on HasSameSize?
https://github.com/llvm/llvm-project/pull/161238
More information about the llvm-commits
mailing list