[llvm] [DA] Fix zero coeff bug in Strong SIV test with runtime assumptions (#149991) (PR #155037)
Sebastian Pop via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 28 05:09:47 PST 2025
================
@@ -3664,14 +3699,18 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst,
} else {
// On the other hand, if all directions are equal and there's no
// loop-independent dependence possible, then no dependence exists.
+ // However, if we added runtime assumptions during the dependence tests,
+ // we must return the result to preserve those assumptions for the caller.
bool AllEqual = true;
for (unsigned II = 1; II <= CommonLevels; ++II) {
if (Result.getDirection(II) != Dependence::DVEntry::EQ) {
AllEqual = false;
break;
}
}
- if (AllEqual)
+ bool AddedAssumptionsDuringTests =
+ Result.Assumptions.getPredicates().size() > AssumptionsBeforeTests;
+ if (AllEqual && !AddedAssumptionsDuringTests)
----------------
sebpop wrote:
Currently we return nullptr when dependence vector is "AllEqual".
This code is here to guard against returning nullptr when the dependence is conditional to runtime assumptions: if we return nullptr the assumptions would be discarded.
We may need to revisit what we return for "no dependence" because we can't attach assumptions to a "nullptr".
https://github.com/llvm/llvm-project/pull/155037
More information about the llvm-commits
mailing list