https://github.com/kasuga-fj created https://github.com/llvm/llvm-project/pull/188212
None >From d22d792c983d23ebaaa5bea836a659e4946ab135 Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga <[email protected]> Date: Tue, 24 Mar 2026 10:35:14 +0000 Subject: [PATCH] [DA] Stop negating Delta in the Weak Zero SIV test --- llvm/lib/Analysis/DependenceAnalysis.cpp | 12 ------------ .../weak-zero-siv-delta-signed-min.ll | 12 ++++++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 3cb6e22ad3a14..566f2cabcd6d6 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -1828,9 +1828,6 @@ bool DependenceInfo::weakZeroSIVtestImpl(const SCEVAddRecExpr *AR, if (!ConstCoeff) return false; - const SCEV *NewDelta = - SE->isKnownNegative(ConstCoeff) ? SE->getNegativeSCEV(Delta) : Delta; - if (const SCEV *UpperBound = collectUpperBound(AR->getLoop(), Delta->getType())) { LLVM_DEBUG(dbgs() << "\t UpperBound = " << *UpperBound << "\n"); @@ -1850,15 +1847,6 @@ bool DependenceInfo::weakZeroSIVtestImpl(const SCEVAddRecExpr *AR, } } - // check that Delta/ARCoeff >= 0 - // really check that NewDelta >= 0 - if (SE->isKnownNegative(NewDelta)) { - // No dependence, newDelta < 0 - ++WeakZeroSIVindependence; - ++WeakZeroSIVsuccesses; - return true; - } - // if ARCoeff doesn't divide Delta, then no dependence if (isa<SCEVConstant>(Delta) && !isRemainderZero(cast<SCEVConstant>(Delta), ConstCoeff)) { diff --git a/llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-delta-signed-min.ll b/llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-delta-signed-min.ll index 90c3477234043..01d4f218a18ec 100644 --- a/llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-delta-signed-min.ll +++ b/llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-delta-signed-min.ll @@ -11,14 +11,14 @@ ; A[-i + (1 << 62)] = 1; ; } ; -; FIXME: There is a dependency between the two stores in all directions. +; There is a dependency between the two stores in all directions. ; define void @weak_zero_src_siv_large_btc(ptr %A) { ; CHECK-ALL-LABEL: 'weak_zero_src_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 - output [S]! ; 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: da analyze - output [*|<]! ; 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! ; @@ -26,7 +26,7 @@ define void @weak_zero_src_siv_large_btc(ptr %A) { ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1 ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [S]! ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1 -; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - none! +; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [*|<]! ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1 ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [*]! ; @@ -63,14 +63,14 @@ exit: ; A[-(1 << 62)] = 1; ; } ; -; FIXME: There is a dependency between the two stores in all directions. +; There is a dependency between the two stores in all directions. ; define void @weak_zero_dst_siv_large_btc(ptr %A) { ; CHECK-ALL-LABEL: 'weak_zero_dst_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 1, ptr %gep.1, align 1 -; CHECK-ALL-NEXT: da analyze - none! +; CHECK-ALL-NEXT: da analyze - output [*|<]! ; 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 - output [S]! ; @@ -78,7 +78,7 @@ define void @weak_zero_dst_siv_large_btc(ptr %A) { ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1 ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [*]! ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1 -; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - none! +; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [*|<]! ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1 ; CHECK-WEAK-ZERO-SRC-SIV-NEXT: da analyze - output [S]! ; _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
