From 85e2a3650185cf68be1ff2df74b447ca4899a96d Mon Sep 17 00:00:00 2001 From: Ryotaro Kasuga Date: Sat, 4 Apr 2026 01:30:42 +0900 Subject: [PATCH] [DA] Remove dead code from the Weak Crossing SIV test (#190355) The ConstantRange intersection check can now handle cases where the condition of this branch is satisfied. The check is performed before entering this function, so this part is no longer necessary. --- llvm/lib/Analysis/DependenceAnalysis.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index da591472d8dc..ab09b2095dcc 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -1402,17 +1402,6 @@ bool DependenceInfo::weakCrossingSIVtest(const SCEVAddRecExpr *Src, if (!ConstDelta) return false; - // We're certain that ConstCoeff > 0; therefore, - // if Delta < 0, then no dependence. - LLVM_DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); - LLVM_DEBUG(dbgs() << "\t ConstCoeff = " << *ConstCoeff << "\n"); - if (SE->isKnownNegative(Delta)) { - // No dependence, Delta < 0 - ++WeakCrossingSIVindependence; - ++WeakCrossingSIVsuccesses; - return true; - } - ConstantRange SrcRange = SE->getSignedRange(Src); ConstantRange DstRange = SE->getSignedRange(Dst); LLVM_DEBUG(dbgs() << "\t SrcRange = " << SrcRange << "\n");