[llvm] [LAA] Allow zero-distance dependences between mixed-width accesses (PR #221531)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 12 11:56:53 PDT 2026
================
@@ -2285,6 +2285,10 @@ MemoryDepChecker::getDependenceDistanceStrideAndSize(
std::optional<uint64_t> CommonStride;
if (StrideAScaled == StrideBScaled)
CommonStride = StrideAScaled;
+ // The zero-distance mixed-width case in isDependent relies on each access
+ // fitting within CommonStride.
+ assert((!CommonStride || *CommonStride >= std::max(ASz, BSz)) &&
+ "Common stride must cover both accesses");
----------------
artagnon wrote:
Ah, the assert isn't so useful here -- as readers can infer it trivially from the code above; I was suggesting putting it at the use-site instead of the comment re-computing ASz and BSz for the assert using [[maybe_unused]], which would not affect release performance, but if it's too much trouble, simply adjust the comment to be a bit clearer, and let's land this?
https://github.com/llvm/llvm-project/pull/221531
More information about the llvm-commits
mailing list