[llvm] d7eda3c - [SCEV][NFC] Remove check for rewriteable types

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 21:44:36 PST 2023


Author: Max Kazantsev
Date: 2023-02-07T12:43:42+07:00
New Revision: d7eda3ca1087978ed74225953436f75c2c220b77

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

LOG: [SCEV][NFC] Remove check for rewriteable types

I guess its only reason to exist is potential CT optimization, otherwise it is
just creating cohesion between this code and rewriter internals. We plan to
extend the rewriter. I'd rather not have this cohesion, unless there is a serious
reason to have it.

Differential Revision: https://reviews.llvm.org/D143246

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index c3190bdce8c3f..723436598eb91 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15041,10 +15041,6 @@ const SCEV *ScalarEvolution::applyLoopGuards(const SCEV *Expr, const Loop *L) {
       Predicate = CmpInst::getSwappedPredicate(Predicate);
     }
 
-    // Limit to expressions that can be rewritten.
-    if (!isa<SCEVUnknown>(LHS) && !isa<SCEVZeroExtendExpr>(LHS))
-      return;
-
     // Check whether LHS has already been rewritten. In that case we want to
     // chain further rewrites onto the already rewritten value.
     auto I = RewriteMap.find(LHS);


        


More information about the llvm-commits mailing list