[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:16:21 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)
----------------
kasuga-fj wrote:
I think the condition should be `Result.Assumptions.getPredicates().empty()`, not `!AddedAssumptionsDuringTests`. If I understand correctly, current implementation silently discards the assumptions added before tests.
https://github.com/llvm/llvm-project/pull/155037
More information about the llvm-commits
mailing list