[PATCH] D73647: [InstCombine] Support non-splat vectors in icmp eq + add/sub fold

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 11:12:51 PST 2020


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

This LG.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:2933
-    if (match(BOp1, m_APInt(BOC))) {
-      if (BO->hasOneUse()) {
-        Constant *SubC = ConstantExpr::getSub(RHS, cast<Constant>(BOp1));
----------------
:/


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:2969-2970
         return new ICmpInst(Pred, BOp0, BOp1);
       }
     }
     break;
----------------
Add a comment that we don't handle the case where we have constant on RHS because we expect it to get folded to `add` and the `add` fold above to happen?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73647





More information about the llvm-commits mailing list