[PATCH] D112895: [CVP] Canonicalize signed relational comparisons of scalar integers to unsigned comparison predicates

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 31 14:23:50 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:322
+  Cmp->replaceAllUsesWith(UnsignedCmp);
+  Cmp->eraseFromParent();
+
----------------
Could just `setPredicate()` here?


================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:331
 /// exploiting range information.
-static bool processCmp(CmpInst *Cmp, LazyValueInfo *LVI) {
+static bool constantFoldNonLocalCmp(CmpInst *Cmp, LazyValueInfo *LVI) {
   Value *Op0 = Cmp->getOperand(0);
----------------
This code also folds local icmps (nowadays). I'd just drop the "NonLocal" part from the name.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112895



More information about the llvm-commits mailing list