[llvm] c27a966 - [SCEV] Remove LCSSA special case in getSCEVAtScope() (NFCI)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 03:53:14 PDT 2023


Author: Nikita Popov
Date: 2023-04-27T12:53:03+02:00
New Revision: c27a96607cd71b0d9b57b108f2a7f90c5a4aa85d

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

LOG: [SCEV] Remove LCSSA special case in getSCEVAtScope() (NFCI)

We no longer try to preserve LCSSA form in SCEV representation:
Nowadays, we look through LCSSA PHI nodes directly during SCEV
construction. As such, this separate special case in
getSCEVAtScope() is no longer needed.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index d82ffe52c4cb..6bfb5c056703 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -10026,17 +10026,6 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) {
             return getSCEV(RV);
         }
       }
-
-      // If there is a single-input Phi, evaluate it at our scope. If we can
-      // prove that this replacement does not break LCSSA form, use new value.
-      if (PN->getNumOperands() == 1) {
-        const SCEV *Input = getSCEV(PN->getOperand(0));
-        const SCEV *InputAtScope = getSCEVAtScope(Input, L);
-        // TODO: We can generalize it using LI.replacementPreservesLCSSAForm,
-        // for the simplest case just support constants.
-        if (isa<SCEVConstant>(InputAtScope))
-          return InputAtScope;
-      }
     }
 
     // Okay, this is an expression that we cannot symbolically evaluate


        


More information about the llvm-commits mailing list