[PATCH] D119558: [SCEV] Add SCEVCompareExpr node

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 20:59:43 PST 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:4153
 
+const SCEV *ScalarEvolution::getCompareExpr(ICmpInst::Predicate Pred,
+                                            const SCEV *LHS,
----------------
I wonder, should we disallow pointer types of LHS and RHS here? I don't see what kind of problems it may bring, just being a bit wary about interpretingo of signed comparisons of pointers.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:13232
+  case scCompareExpr: {
+    const SCEVCompareExpr *UDiv = cast<SCEVCompareExpr>(S);
+    const SCEV *LHS = UDiv->getLHS(), *RHS = UDiv->getRHS();
----------------
`UDiv -> Cmp`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119558/new/

https://reviews.llvm.org/D119558



More information about the llvm-commits mailing list