[llvm] [DA] Fix zero coeff bug in Strong SIV test with runtime assumptions (#149991) (PR #155037)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 28 05:33:20 PST 2025
================
@@ -1368,7 +1369,35 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst,
Result.DV[Level].Direction &= Dependence::DVEntry::EQ;
++StrongSIVsuccesses;
} else if (Delta->isZero()) {
- // since 0/X == 0
+ // Check if coefficient could be zero. If so, 0/0 is undefined and we
+ // cannot conclude that only same-iteration dependencies exist.
+ // When coeff=0, all iterations access the same location.
+ if (isa<SCEVUnknown>(Coeff)) {
----------------
kasuga-fj wrote:
`isa<SCEVConstant>(Coeff)` would be redundant.
https://github.com/llvm/llvm-project/pull/155037
More information about the llvm-commits
mailing list