[llvm] b7059eb - [LSR] Strip dead code (NFC) (#146109)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 05:37:12 PDT 2025


Author: Ramkumar Ramachandra
Date: 2025-07-03T13:37:08+01:00
New Revision: b7059ebafe8a8f6ff2c20a93701ccbd6e009be79

URL: https://github.com/llvm/llvm-project/commit/b7059ebafe8a8f6ff2c20a93701ccbd6e009be79
DIFF: https://github.com/llvm/llvm-project/commit/b7059ebafe8a8f6ff2c20a93701ccbd6e009be79.diff

LOG: [LSR] Strip dead code (NFC) (#146109)

Nested AddRec is already rejected by the handling in pushSCEV().

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 786e4516ace05..845afa6d4228b 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -6468,10 +6468,6 @@ struct SCEVDbgValueBuilder {
   /// Chain (non-affine) SCEVs are not supported.
   bool SCEVToValueExpr(const llvm::SCEVAddRecExpr &SAR, ScalarEvolution &SE) {
     assert(SAR.isAffine() && "Expected affine SCEV");
-    // TODO: Is this check needed?
-    if (isa<SCEVAddRecExpr>(SAR.getStart()))
-      return false;
-
     const SCEV *Start = SAR.getStart();
     const SCEV *Stride = SAR.getStepRecurrence(SE);
 
@@ -6539,11 +6535,6 @@ struct SCEVDbgValueBuilder {
   bool SCEVToIterCountExpr(const llvm::SCEVAddRecExpr &SAR,
                            ScalarEvolution &SE) {
     assert(SAR.isAffine() && "Expected affine SCEV");
-    if (isa<SCEVAddRecExpr>(SAR.getStart())) {
-      LLVM_DEBUG(dbgs() << "scev-salvage: IV SCEV. Unsupported nested AddRec: "
-                        << SAR << '\n');
-      return false;
-    }
     const SCEV *Start = SAR.getStart();
     const SCEV *Stride = SAR.getStepRecurrence(SE);
 


        


More information about the llvm-commits mailing list