[PATCH] D143246: [SCEV][NFC] Remove check for rewriteable types

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 00:32:03 PST 2023


mkazantsev created this revision.
mkazantsev added reviewers: nikic, fhahn, reames, lebedev.ri.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
mkazantsev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D143246

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp


Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -15041,10 +15041,6 @@
       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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143246.494532.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230203/acf56e89/attachment-0001.bin>


More information about the llvm-commits mailing list