[llvm-branch-commits] [llvm] [DA] Fix Strong SIV test for symbolic coefficients and deltas (#149977) (PR #157738)
Sushant Gokhale via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 15 04:39:42 PDT 2025
================
@@ -1249,10 +1249,33 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst,
SE->isKnownNonNegative(Coeff) ? Coeff : SE->getNegativeSCEV(Coeff);
const SCEV *Product = SE->getMulExpr(UpperBound, AbsCoeff);
if (isKnownPredicate(CmpInst::ICMP_SGT, AbsDelta, Product)) {
- // Distance greater than trip count - no dependence
- ++StrongSIVindependence;
- ++StrongSIVsuccesses;
- return true;
+ // Check if this involves symbolic expressions where we might be too
+ // conservative.
+ if (isa<SCEVUnknown>(Delta) || isa<SCEVUnknown>(Coeff) ||
+ !isa<SCEVConstant>(AbsDelta) || !isa<SCEVConstant>(Product)) {
+ // For symbolic expressions, add runtime assumption rather than
+ // rejecting.
+ const SCEVPredicate *BoundPred =
+ SE->getComparePredicate(ICmpInst::ICMP_SLE, AbsDelta, Product);
----------------
sushgokh wrote:
push this inside if(){...}
https://github.com/llvm/llvm-project/pull/157738
More information about the llvm-branch-commits
mailing list