[llvm] 8f76522 - [SCEV] Remove mul handling from BuildConstantFromSCEV()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 07:58:12 PST 2023


Author: Nikita Popov
Date: 2023-11-06T16:58:04+01:00
New Revision: 8f76522a61d01cf7d70debd39418259e969bb8d6

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

LOG: [SCEV] Remove mul handling from BuildConstantFromSCEV()

We can't support this once mul constant expressions are removed,
and this is not useful in any practical sense (as this code is
primarily intended for GEP expressions).

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 3a3d41dac78574c..7cf5f21639d0188 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -9688,18 +9688,7 @@ static Constant *BuildConstantFromSCEV(const SCEV *V) {
     }
     return C;
   }
-  case scMulExpr: {
-    const SCEVMulExpr *SM = cast<SCEVMulExpr>(V);
-    Constant *C = nullptr;
-    for (const SCEV *Op : SM->operands()) {
-      assert(!Op->getType()->isPointerTy() && "Can't multiply pointers");
-      Constant *OpC = BuildConstantFromSCEV(Op);
-      if (!OpC)
-        return nullptr;
-      C = C ? ConstantExpr::getMul(C, OpC) : OpC;
-    }
-    return C;
-  }
+  case scMulExpr:
   case scSignExtend:
   case scZeroExtend:
   case scUDivExpr:


        


More information about the llvm-commits mailing list