[llvm] [DA] Fix overflow in symbolic RDIV test (PR #185805)

Ruoyu Qiu via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 04:04:42 PDT 2026


https://github.com/cabbaken updated https://github.com/llvm/llvm-project/pull/185805

>From fe7624c4f3420a6bd8a8e4932faa2d40ef0df579 Mon Sep 17 00:00:00 2001
From: Ruoyu Qiu <cabbaken at outlook.com>
Date: Wed, 11 Mar 2026 05:05:47 +0000
Subject: [PATCH 1/4] [DA] Fix overflow in symbolic RDIV test

The symbolic RDIV test relies on computing the extremes of affine
expressions (e.g., A1*N1 and A2*N2) to disprove dependencies. These
calculations were previously done using `SE->getMulExpr` and
`SE->getMinusSCEV` without guarding against signed integer overflow.
If large coefficients or loop bounds cause a wrap, `isKnownPredicate`
evaluates the wrapped values, potentially disproving a valid dependence
and leading to miscompilations.

This patch reimplement symbolicRDIVtest with `ConstantRange`, works
around overflows.

Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
---
 .../llvm/Analysis/DependenceAnalysis.h        |   3 +-
 llvm/lib/Analysis/DependenceAnalysis.cpp      | 114 +++---------------
 .../Analysis/DependenceAnalysis/StrongSIV.ll  |  13 +-
 .../DependenceAnalysis/exact-siv-overflow.ll  |   2 +-
 .../DependenceAnalysis/gcd-miv-overflow.ll    |   2 +-
 .../DependenceAnalysis/non-monotonic.ll       |   2 +-
 .../DependenceAnalysis/rdiv-large-btc.ll      |   6 +-
 .../strong-siv-large-btc.ll                   |  25 ++--
 .../DependenceAnalysis/strong-siv-overflow.ll |  25 ++--
 .../symbolic-rdiv-addrec-wrap.ll              |   6 +-
 .../symbolic-rdiv-overflow.ll                 |  10 +-
 11 files changed, 54 insertions(+), 154 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h
index 6348f7a459c7b..5e82a10a70843 100644
--- a/llvm/include/llvm/Analysis/DependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h
@@ -592,8 +592,7 @@ class DependenceInfo {
   /// Works in some cases that exactRDIVtest doesn't,
   /// and vice versa. Can also be used as a backup for
   /// ordinary SIV tests.
-  bool symbolicRDIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff,
-                        const SCEV *SrcConst, const SCEV *DstConst,
+  bool symbolicRDIVtest(const SCEVAddRecExpr *Src, const SCEVAddRecExpr *Dst,
                         const Loop *SrcLoop, const Loop *DstLoop) const;
 
   /// gcdMIVtest - Tests an MIV subscript pair for dependence.
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index ab8a43df2f259..3524e4f1adca5 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -2155,108 +2155,26 @@ bool DependenceInfo::exactRDIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff,
 //        a1*N1         <= c2 - c1 <=       -a2*N2
 //
 // return true if dependence disproved
-bool DependenceInfo::symbolicRDIVtest(const SCEV *A1, const SCEV *A2,
-                                      const SCEV *C1, const SCEV *C2,
+bool DependenceInfo::symbolicRDIVtest(const SCEVAddRecExpr *Src,
+                                      const SCEVAddRecExpr *Dst,
                                       const Loop *Loop1,
                                       const Loop *Loop2) const {
   if (!isDependenceTestEnabled(DependenceTestType::SymbolicRDIV))
     return false;
 
+  if (!Src->hasNoSignedWrap() || !Dst->hasNoSignedWrap())
+    return false;
+
   ++SymbolicRDIVapplications;
   LLVM_DEBUG(dbgs() << "\ttry symbolic RDIV test\n");
-  LLVM_DEBUG(dbgs() << "\t    A1 = " << *A1);
-  LLVM_DEBUG(dbgs() << ", type = " << *A1->getType() << "\n");
-  LLVM_DEBUG(dbgs() << "\t    A2 = " << *A2 << "\n");
-  LLVM_DEBUG(dbgs() << "\t    C1 = " << *C1 << "\n");
-  LLVM_DEBUG(dbgs() << "\t    C2 = " << *C2 << "\n");
-  const SCEV *N1 = collectUpperBound(Loop1, A1->getType());
-  const SCEV *N2 = collectUpperBound(Loop2, A1->getType());
-  LLVM_DEBUG(if (N1) dbgs() << "\t    N1 = " << *N1 << "\n");
-  LLVM_DEBUG(if (N2) dbgs() << "\t    N2 = " << *N2 << "\n");
-  const SCEV *C2_C1 = SE->getMinusSCEV(C2, C1);
-  const SCEV *C1_C2 = SE->getMinusSCEV(C1, C2);
-  LLVM_DEBUG(dbgs() << "\t    C2 - C1 = " << *C2_C1 << "\n");
-  LLVM_DEBUG(dbgs() << "\t    C1 - C2 = " << *C1_C2 << "\n");
-  if (SE->isKnownNonNegative(A1)) {
-    if (SE->isKnownNonNegative(A2)) {
-      // A1 >= 0 && A2 >= 0
-      if (N1) {
-        // make sure that c2 - c1 <= a1*N1
-        const SCEV *A1N1 = SE->getMulExpr(A1, N1);
-        LLVM_DEBUG(dbgs() << "\t    A1*N1 = " << *A1N1 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SGT, C2_C1, A1N1)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-      if (N2) {
-        // make sure that -a2*N2 <= c2 - c1, or a2*N2 >= c1 - c2
-        const SCEV *A2N2 = SE->getMulExpr(A2, N2);
-        LLVM_DEBUG(dbgs() << "\t    A2*N2 = " << *A2N2 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SLT, A2N2, C1_C2)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-    } else if (SE->isKnownNonPositive(A2)) {
-      // a1 >= 0 && a2 <= 0
-      if (N1 && N2) {
-        // make sure that c2 - c1 <= a1*N1 - a2*N2
-        const SCEV *A1N1 = SE->getMulExpr(A1, N1);
-        const SCEV *A2N2 = SE->getMulExpr(A2, N2);
-        const SCEV *A1N1_A2N2 = SE->getMinusSCEV(A1N1, A2N2);
-        LLVM_DEBUG(dbgs() << "\t    A1*N1 - A2*N2 = " << *A1N1_A2N2 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SGT, C2_C1, A1N1_A2N2)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-      // make sure that 0 <= c2 - c1
-      if (SE->isKnownNegative(C2_C1)) {
-        ++SymbolicRDIVindependence;
-        return true;
-      }
-    }
-  } else if (SE->isKnownNonPositive(A1)) {
-    if (SE->isKnownNonNegative(A2)) {
-      // a1 <= 0 && a2 >= 0
-      if (N1 && N2) {
-        // make sure that a1*N1 - a2*N2 <= c2 - c1
-        const SCEV *A1N1 = SE->getMulExpr(A1, N1);
-        const SCEV *A2N2 = SE->getMulExpr(A2, N2);
-        const SCEV *A1N1_A2N2 = SE->getMinusSCEV(A1N1, A2N2);
-        LLVM_DEBUG(dbgs() << "\t    A1*N1 - A2*N2 = " << *A1N1_A2N2 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SGT, A1N1_A2N2, C2_C1)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-      // make sure that c2 - c1 <= 0
-      if (SE->isKnownPositive(C2_C1)) {
-        ++SymbolicRDIVindependence;
-        return true;
-      }
-    } else if (SE->isKnownNonPositive(A2)) {
-      // a1 <= 0 && a2 <= 0
-      if (N1) {
-        // make sure that a1*N1 <= c2 - c1
-        const SCEV *A1N1 = SE->getMulExpr(A1, N1);
-        LLVM_DEBUG(dbgs() << "\t    A1*N1 = " << *A1N1 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SGT, A1N1, C2_C1)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-      if (N2) {
-        // make sure that c2 - c1 <= -a2*N2, or c1 - c2 >= a2*N2
-        const SCEV *A2N2 = SE->getMulExpr(A2, N2);
-        LLVM_DEBUG(dbgs() << "\t    A2*N2 = " << *A2N2 << "\n");
-        if (SE->isKnownPredicate(CmpInst::ICMP_SLT, C1_C2, A2N2)) {
-          ++SymbolicRDIVindependence;
-          return true;
-        }
-      }
-    }
+  // First try to prove independence based on the ranges of the two subscripts.
+  ConstantRange SrcRange = SE->getSignedRange(Src);
+  ConstantRange DstRange = SE->getSignedRange(Dst);
+  LLVM_DEBUG(dbgs() << "\n SrcRange: " << SrcRange << "\n");
+  LLVM_DEBUG(dbgs() << "\n DstRange: " << DstRange << "\n");
+  if (SrcRange.intersectWith(DstRange).isEmptySet()) {
+    ++SymbolicRDIVindependence;
+    return true;
   }
   return false;
 }
@@ -2298,8 +2216,7 @@ bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level,
       disproven = exactSIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst,
                                CurSrcLoop, CurDstLoop, Level, Result);
     return disproven || gcdMIVtest(Src, Dst, Result) ||
-           symbolicRDIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, CurSrcLoop,
-                            CurDstLoop);
+           symbolicRDIVtest(SrcAddRec, DstAddRec, CurSrcLoop, CurDstLoop);
   }
   if (SrcAddRec) {
     const SCEV *SrcConst = SrcAddRec->getStart();
@@ -2357,8 +2274,7 @@ bool DependenceInfo::testRDIV(const SCEV *Src, const SCEV *Dst,
   return exactRDIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, SrcLoop, DstLoop,
                        Result) ||
          gcdMIVtest(Src, Dst, Result) ||
-         symbolicRDIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, SrcLoop,
-                          DstLoop);
+         symbolicRDIVtest(SrcAddRec, DstAddRec, SrcLoop, DstLoop);
 }
 
 // Tests the single-subscript MIV pair (Src and Dst) for dependence.
diff --git a/llvm/test/Analysis/DependenceAnalysis/StrongSIV.ll b/llvm/test/Analysis/DependenceAnalysis/StrongSIV.ll
index 03ae46b6c3f8b..732f770e931a0 100644
--- a/llvm/test/Analysis/DependenceAnalysis/StrongSIV.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/StrongSIV.ll
@@ -522,13 +522,9 @@ for.end:                                          ; preds = %for.body
 ;;        A[i] = 0;
 
 define void @strong11(ptr %A) nounwind uwtable ssp {
-; CHECK-ALL-LABEL: 'strong11'
-; CHECK-ALL-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4
-; CHECK-ALL-NEXT:    da analyze - none!
-;
-; CHECK-STRONG-SIV-LABEL: 'strong11'
-; CHECK-STRONG-SIV-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4
-; CHECK-STRONG-SIV-NEXT:    da analyze - output [* S]!
+; CHECK-LABEL: 'strong11'
+; CHECK-NEXT:  Src: store i32 0, ptr %arrayidx, align 4 --> Dst: store i32 0, ptr %arrayidx, align 4
+; CHECK-NEXT:    da analyze - output [* S]!
 ;
 entry:
   br label %for.cond1.preheader
@@ -554,3 +550,6 @@ for.cond.cleanup3:                                ; preds = %for.body4.us, %for.
   %exitcond19.not = icmp eq i64 %inc8, 9223372036854775806
   br i1 %exitcond19.not, label %for.cond.cleanup, label %for.cond1.preheader
 }
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK-ALL: {{.*}}
+; CHECK-STRONG-SIV: {{.*}}
diff --git a/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
index ba6e0f043b528..f24d68a6bfe88 100644
--- a/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
@@ -28,7 +28,7 @@ define void @exactsiv_const_ovfl(ptr %A) {
 ; CHECK-NEXT:  Src: store i8 0, ptr %idx.0, align 1 --> Dst: store i8 0, ptr %idx.0, align 1
 ; CHECK-NEXT:    da analyze - none!
 ; CHECK-NEXT:  Src: store i8 0, ptr %idx.0, align 1 --> Dst: store i8 1, ptr %idx.1, align 1
-; CHECK-NEXT:    da analyze - none!
+; CHECK-NEXT:    da analyze - output [*|<]!
 ; CHECK-NEXT:  Src: store i8 1, ptr %idx.1, align 1 --> Dst: store i8 1, ptr %idx.1, align 1
 ; CHECK-NEXT:    da analyze - none!
 ;
diff --git a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
index 7969eeb9083b6..232abd1926322 100644
--- a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
@@ -83,7 +83,7 @@ define void @gcdmiv_delta_ovfl(ptr %A) {
 ; CHECK-ALL-NEXT:  Src: store i8 0, ptr %idx.0, align 1 --> Dst: store i8 0, ptr %idx.0, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ; CHECK-ALL-NEXT:  Src: store i8 0, ptr %idx.0, align 1 --> Dst: store i8 1, ptr %idx.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
+; CHECK-ALL-NEXT:    da analyze - output [*|<]!
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %idx.1, align 1 --> Dst: store i8 1, ptr %idx.1, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ;
diff --git a/llvm/test/Analysis/DependenceAnalysis/non-monotonic.ll b/llvm/test/Analysis/DependenceAnalysis/non-monotonic.ll
index 6247336456d2c..991d0b83fa504 100644
--- a/llvm/test/Analysis/DependenceAnalysis/non-monotonic.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/non-monotonic.ll
@@ -48,7 +48,7 @@ define void @f(ptr %A) {
 ; DISABLE-CHECK-NEXT:  Src: store i8 1, ptr %idx.0, align 1 --> Dst: store i8 2, ptr %idx.1, align 1
 ; DISABLE-CHECK-NEXT:    da analyze - none!
 ; DISABLE-CHECK-NEXT:  Src: store i8 2, ptr %idx.1, align 1 --> Dst: store i8 2, ptr %idx.1, align 1
-; DISABLE-CHECK-NEXT:    da analyze - none!
+; DISABLE-CHECK-NEXT:    da analyze - output [*]!
 ;
 entry:
   br label %loop.header
diff --git a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
index 96b2006a1cb0b..27c55c580dcb6 100644
--- a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
@@ -37,11 +37,11 @@ define void @rdiv_large_btc(ptr %A) {
 ;
 ; CHECK-SYMBOLIC-RDIV-LABEL: 'rdiv_large_btc'
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [|<]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 0, ptr %gep.1, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ;
 entry:
   br label %loop.0.header
diff --git a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
index 4fb28e8237285..cf42d2de21652 100644
--- a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
@@ -17,21 +17,13 @@
 ; dependency between them.
 ;
 define void @strong_siv_large_btc(ptr %A) {
-; CHECK-ALL-LABEL: 'strong_siv_large_btc'
-; CHECK-ALL-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-; CHECK-ALL-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-; CHECK-ALL-NEXT:  Src: store i8 0, ptr %gep.1, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-;
-; CHECK-STRONG-SIV-LABEL: 'strong_siv_large_btc'
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - none!
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - output [-1]!
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 0, ptr %gep.1, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - none!
+; CHECK-LABEL: 'strong_siv_large_btc'
+; CHECK-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
+; CHECK-NEXT:    da analyze - none!
+; CHECK-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
+; CHECK-NEXT:    da analyze - output [-1]!
+; CHECK-NEXT:  Src: store i8 0, ptr %gep.1, align 1 --> Dst: store i8 0, ptr %gep.1, align 1
+; CHECK-NEXT:    da analyze - none!
 ;
 entry:
   br label %loop.header
@@ -66,4 +58,5 @@ exit:
   ret void
 }
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CHECK: {{.*}}
+; CHECK-ALL: {{.*}}
+; CHECK-STRONG-SIV: {{.*}}
diff --git a/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
index 18541cca6f575..f372c34623186 100644
--- a/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
@@ -15,21 +15,13 @@
 ; FIXME: DependenceAnalysis fails to detect the dependency between the two
 ; stores, and the issue is not caused by the Strong SIV.
 define void @strongsiv_const_ovfl(ptr %A) {
-; CHECK-ALL-LABEL: 'strongsiv_const_ovfl'
-; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-; CHECK-ALL-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
-;
-; CHECK-STRONG-SIV-LABEL: 'strongsiv_const_ovfl'
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - none!
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - output [1]!
-; CHECK-STRONG-SIV-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-STRONG-SIV-NEXT:    da analyze - none!
+; CHECK-LABEL: 'strongsiv_const_ovfl'
+; CHECK-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
+; CHECK-NEXT:    da analyze - none!
+; CHECK-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
+; CHECK-NEXT:    da analyze - output [1]!
+; CHECK-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
+; CHECK-NEXT:    da analyze - none!
 ;
 entry:
   br label %loop.header
@@ -69,4 +61,5 @@ exit:
   ret void
 }
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CHECK: {{.*}}
+; CHECK-ALL: {{.*}}
+; CHECK-STRONG-SIV: {{.*}}
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
index 91d43a280fdf0..f88c64ca037bf 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
@@ -28,15 +28,15 @@ define void @symbolic_rdiv_addrec_wrap(ptr %A) {
 ; CHECK-ALL-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
+; CHECK-ALL-NEXT:    da analyze - output [*]!
 ;
 ; CHECK-SYMBOLIC-RDIV-LABEL: 'symbolic_rdiv_addrec_wrap'
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
 ; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*|<]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ;
 entry:
   %tc = shl i64 1, 60
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
index 7ad1b9e06daec..555fb4def8e54 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
@@ -20,15 +20,15 @@ define void @symbolicrdiv_prod_ovfl(ptr %A) {
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
+; CHECK-ALL-NEXT:    da analyze - output [*|<]!
 ; CHECK-ALL-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ;
 ; CHECK-SYMBOLIC-RDIV-LABEL: 'symbolicrdiv_prod_ovfl'
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*|<]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
 ; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ;
@@ -87,7 +87,7 @@ define void @symbolicrdiv_delta_ovfl(ptr %A) {
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-ALL-NEXT:    da analyze - none!
+; CHECK-ALL-NEXT:    da analyze - output [*|<]!
 ; CHECK-ALL-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
 ; CHECK-ALL-NEXT:    da analyze - none!
 ;
@@ -95,7 +95,7 @@ define void @symbolicrdiv_delta_ovfl(ptr %A) {
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
 ; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
-; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - none!
+; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*|<]!
 ; CHECK-SYMBOLIC-RDIV-NEXT:  Src: store i8 2, ptr %gep.1, align 1 --> Dst: store i8 2, ptr %gep.1, align 1
 ; CHECK-SYMBOLIC-RDIV-NEXT:    da analyze - output [*]!
 ;

>From e1efecf8e51ef79cbbeda3da5c22c23f06b318d4 Mon Sep 17 00:00:00 2001
From: Ruoyu Qiu <cabbaken at outlook.com>
Date: Tue, 17 Mar 2026 17:07:25 +0800
Subject: [PATCH 2/4] Apply suggestions from code review

Co-authored-by: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
---
 llvm/lib/Analysis/DependenceAnalysis.cpp                     | 1 -
 llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll    | 2 +-
 llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll      | 1 +
 .../test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll | 1 +
 llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll | 3 +--
 .../Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll | 1 -
 .../Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll    | 5 ++---
 7 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index 3524e4f1adca5..6cb49ccc18eed 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -2167,7 +2167,6 @@ bool DependenceInfo::symbolicRDIVtest(const SCEVAddRecExpr *Src,
 
   ++SymbolicRDIVapplications;
   LLVM_DEBUG(dbgs() << "\ttry symbolic RDIV test\n");
-  // First try to prove independence based on the ranges of the two subscripts.
   ConstantRange SrcRange = SE->getSignedRange(Src);
   ConstantRange DstRange = SE->getSignedRange(Dst);
   LLVM_DEBUG(dbgs() << "\n SrcRange: " << SrcRange << "\n");
diff --git a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
index 232abd1926322..d32dc204dff9b 100644
--- a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
@@ -70,7 +70,7 @@ exit:
 ; }
 ;
 ; FIXME: DependenceAnalysis currently detects no dependency between the two
-; stores, but it does exist. For example,
+; There is a bidirectional dependency between the two stores, for example,
 ;
 ;  memory access       | i == 1 | i == (max_i + 1) / 2 | i == max_i
 ; ---------------------|--------|----------------------|-------------------
diff --git a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
index 27c55c580dcb6..cc55b1ae738ff 100644
--- a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
@@ -16,6 +16,7 @@
 ; }
 ;
 ; FIXME: Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
+; Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; dependency between them.
 ;
 define void @rdiv_large_btc(ptr %A) {
diff --git a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
index cf42d2de21652..655531e1171b6 100644
--- a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
@@ -14,6 +14,7 @@
 ; }
 ;
 ; FIXME: Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
+; Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; dependency between them.
 ;
 define void @strong_siv_large_btc(ptr %A) {
diff --git a/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
index f372c34623186..e3c8b5cf09b75 100644
--- a/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/strong-siv-overflow.ll
@@ -12,8 +12,7 @@
 ;     A[2*i - 4] = 2;
 ; }
 ;
-; FIXME: DependenceAnalysis fails to detect the dependency between the two
-; stores, and the issue is not caused by the Strong SIV.
+; There is a dependency with distance 1 between the two stores.
 define void @strongsiv_const_ovfl(ptr %A) {
 ; CHECK-LABEL: 'strongsiv_const_ovfl'
 ; CHECK-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
index f88c64ca037bf..336c8641f2a2e 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
@@ -19,7 +19,6 @@
 ;  A[32*i + 2^62] |        | A[0]             | A[2^60 - 32]                |
 ;
 ; FIXME: DependenceAnalysis fails to detect the dependency between the two
-; stores.
 ;
 define void @symbolic_rdiv_addrec_wrap(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolic_rdiv_addrec_wrap'
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
index 555fb4def8e54..558adde358449 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
@@ -14,7 +14,7 @@
 ; stores, but it does exist. For example, each store will access A[0] when i
 ; is 1 and 0 respectively.
 ; The root cause is that the product of the BTC and the coefficient
-; ((1LL << 62) - 1 and 2) overflows in a signed sense.
+; There is a dependency between the two stores.
 define void @symbolicrdiv_prod_ovfl(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolicrdiv_prod_ovfl'
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
@@ -73,7 +73,7 @@ exit:
 ; }
 ;
 ; FIXME: DependenceAnalysis currently detects no dependency between the two
-; stores, but it does exist. For example,
+; There is a dependency between the two stores, for example,
 ;
 ;  memory access           | i == 2^61 | i == 2^61 + 2^59 | i == 2^61 + 2^60
 ; -------------------------|-----------|------------------|-------------------
@@ -81,7 +81,6 @@ exit:
 ;  A[-i + 2^62]  (offset1) | A[2^61]   |                  | A[2^60]
 ;
 ; The root cause is that the calculation of the differenct between the two
-; constants (-2^62 and 2^62) overflows in a signed sense.
 define void @symbolicrdiv_delta_ovfl(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolicrdiv_delta_ovfl'
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1

>From 5ca1b75a8145dc227e0725ca19dcfcc8a1d3179f Mon Sep 17 00:00:00 2001
From: Ruoyu Qiu <cabbaken at outlook.com>
Date: Tue, 17 Mar 2026 09:14:47 +0000
Subject: [PATCH 3/4] Remove unneeded arguments

Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
---
 llvm/include/llvm/Analysis/DependenceAnalysis.h | 4 ++--
 llvm/lib/Analysis/DependenceAnalysis.cpp        | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h
index 5e82a10a70843..8df5a3ac3bfeb 100644
--- a/llvm/include/llvm/Analysis/DependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h
@@ -592,8 +592,8 @@ class DependenceInfo {
   /// Works in some cases that exactRDIVtest doesn't,
   /// and vice versa. Can also be used as a backup for
   /// ordinary SIV tests.
-  bool symbolicRDIVtest(const SCEVAddRecExpr *Src, const SCEVAddRecExpr *Dst,
-                        const Loop *SrcLoop, const Loop *DstLoop) const;
+  bool symbolicRDIVtest(const SCEVAddRecExpr *Src,
+                        const SCEVAddRecExpr *Dst) const;
 
   /// gcdMIVtest - Tests an MIV subscript pair for dependence.
   /// Returns true if any possible dependence is disproved.
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index 6cb49ccc18eed..f2a8a4f7e2c3a 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -2156,9 +2156,7 @@ bool DependenceInfo::exactRDIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff,
 //
 // return true if dependence disproved
 bool DependenceInfo::symbolicRDIVtest(const SCEVAddRecExpr *Src,
-                                      const SCEVAddRecExpr *Dst,
-                                      const Loop *Loop1,
-                                      const Loop *Loop2) const {
+                                      const SCEVAddRecExpr *Dst) const {
   if (!isDependenceTestEnabled(DependenceTestType::SymbolicRDIV))
     return false;
 
@@ -2215,7 +2213,7 @@ bool DependenceInfo::testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level,
       disproven = exactSIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst,
                                CurSrcLoop, CurDstLoop, Level, Result);
     return disproven || gcdMIVtest(Src, Dst, Result) ||
-           symbolicRDIVtest(SrcAddRec, DstAddRec, CurSrcLoop, CurDstLoop);
+           symbolicRDIVtest(SrcAddRec, DstAddRec);
   }
   if (SrcAddRec) {
     const SCEV *SrcConst = SrcAddRec->getStart();
@@ -2272,8 +2270,7 @@ bool DependenceInfo::testRDIV(const SCEV *Src, const SCEV *Dst,
     llvm_unreachable("RDIV expected at least one AddRec");
   return exactRDIVtest(SrcCoeff, DstCoeff, SrcConst, DstConst, SrcLoop, DstLoop,
                        Result) ||
-         gcdMIVtest(Src, Dst, Result) ||
-         symbolicRDIVtest(SrcAddRec, DstAddRec, SrcLoop, DstLoop);
+         gcdMIVtest(Src, Dst, Result) || symbolicRDIVtest(SrcAddRec, DstAddRec);
 }
 
 // Tests the single-subscript MIV pair (Src and Dst) for dependence.

>From 81a710587558bb2ccdce9a7f7b21d95720c39815 Mon Sep 17 00:00:00 2001
From: Ruoyu Qiu <cabbaken at outlook.com>
Date: Tue, 17 Mar 2026 11:03:49 +0000
Subject: [PATCH 4/4] Update comments and remove unneed code.

Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
---
 llvm/lib/Analysis/DependenceAnalysis.cpp                 | 3 ---
 .../Analysis/DependenceAnalysis/exact-siv-overflow.ll    | 5 ++---
 .../test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll | 1 -
 llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll  | 1 -
 .../Analysis/DependenceAnalysis/strong-siv-large-btc.ll  | 1 -
 .../DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll      | 2 --
 .../DependenceAnalysis/symbolic-rdiv-overflow.ll         | 9 ++-------
 7 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp
index f2a8a4f7e2c3a..5e4271839dd25 100644
--- a/llvm/lib/Analysis/DependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/DependenceAnalysis.cpp
@@ -2160,9 +2160,6 @@ bool DependenceInfo::symbolicRDIVtest(const SCEVAddRecExpr *Src,
   if (!isDependenceTestEnabled(DependenceTestType::SymbolicRDIV))
     return false;
 
-  if (!Src->hasNoSignedWrap() || !Dst->hasNoSignedWrap())
-    return false;
-
   ++SymbolicRDIVapplications;
   LLVM_DEBUG(dbgs() << "\ttry symbolic RDIV test\n");
   ConstantRange SrcRange = SE->getSignedRange(Src);
diff --git a/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
index f24d68a6bfe88..e982e113231a5 100644
--- a/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/exact-siv-overflow.ll
@@ -9,9 +9,8 @@
 ;;   if (i)
 ;;     A[3*i - 2] = 1;
 ;; }
-;;
-;; FIXME: DependencyAnalsysis currently detects no dependency between
-;; `A[-6*i + INT64_MAX]` and `A[3*i - 2]`, but it does exist. For example,
+;; There is a bidirectional dependency between `A[-6*i + INT64_MAX]`
+;; and `A[3*i - 2]`, for example,
 ;;
 ;; | memory location        | -6*i + INT64_MAX       | 3*i - 2
 ;; |------------------------|------------------------|-----------
diff --git a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
index d32dc204dff9b..aed352e595ebc 100644
--- a/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/gcd-miv-overflow.ll
@@ -69,7 +69,6 @@ exit:
 ;     A[3*i - 2] = 1;
 ; }
 ;
-; FIXME: DependenceAnalysis currently detects no dependency between the two
 ; There is a bidirectional dependency between the two stores, for example,
 ;
 ;  memory access       | i == 1 | i == (max_i + 1) / 2 | i == max_i
diff --git a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
index cc55b1ae738ff..575b22028e40a 100644
--- a/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
@@ -15,7 +15,6 @@
 ;     A[i1] = 0;
 ; }
 ;
-; FIXME: Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; dependency between them.
 ;
diff --git a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
index 655531e1171b6..ff514627f4d71 100644
--- a/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/strong-siv-large-btc.ll
@@ -13,7 +13,6 @@
 ;     A[i1] = 0;
 ; }
 ;
-; FIXME: Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; Both `A[i0] = 0` and `A[i1] = 0` must be executed, so there is a
 ; dependency between them.
 ;
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
index 336c8641f2a2e..f1df9e99db354 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-addrec-wrap.ll
@@ -18,8 +18,6 @@
 ;  A[i]           | A[0]   |                  |                             | A[2^60 - 32]
 ;  A[32*i + 2^62] |        | A[0]             | A[2^60 - 32]                |
 ;
-; FIXME: DependenceAnalysis fails to detect the dependency between the two
-;
 define void @symbolic_rdiv_addrec_wrap(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolic_rdiv_addrec_wrap'
 ; CHECK-ALL-NEXT:  Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
diff --git a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
index 558adde358449..f99cc08adf706 100644
--- a/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
+++ b/llvm/test/Analysis/DependenceAnalysis/symbolic-rdiv-overflow.ll
@@ -10,11 +10,8 @@
 ;   A[i] = 2;
 ; }
 ;
-; FIXME: DependenceAnalysis currently detects no dependency between the two
-; stores, but it does exist. For example, each store will access A[0] when i
-; is 1 and 0 respectively.
-; The root cause is that the product of the BTC and the coefficient
-; There is a dependency between the two stores.
+; There is a dependency between the two stores, for example, each store 
+; will access A[0] when i is 1 and 0 respectively.
 define void @symbolicrdiv_prod_ovfl(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolicrdiv_prod_ovfl'
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1
@@ -72,7 +69,6 @@ exit:
 ;   offset1 -= 1;
 ; }
 ;
-; FIXME: DependenceAnalysis currently detects no dependency between the two
 ; There is a dependency between the two stores, for example,
 ;
 ;  memory access           | i == 2^61 | i == 2^61 + 2^59 | i == 2^61 + 2^60
@@ -80,7 +76,6 @@ exit:
 ;  A[2*i - 2^62] (offset0) |           | A[2^60]          | A[2^61]
 ;  A[-i + 2^62]  (offset1) | A[2^61]   |                  | A[2^60]
 ;
-; The root cause is that the calculation of the differenct between the two
 define void @symbolicrdiv_delta_ovfl(ptr %A) {
 ; CHECK-ALL-LABEL: 'symbolicrdiv_delta_ovfl'
 ; CHECK-ALL-NEXT:  Src: store i8 1, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.0, align 1



More information about the llvm-commits mailing list