[SCEV][NFC] Remove check for rewriteable types
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 7 Feb 2023 05:17:24 +0000 (12:17 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 7 Feb 2023 05:43:42 +0000 (12:43 +0700)
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

llvm/lib/Analysis/ScalarEvolution.cpp

index c3190bd..7234365 100644 (file)
@@ -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);