[PATCH] D36443: [InstCombine] Support pulling left shifts through a subtract with constant LHS

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 13:03:13 PDT 2017


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

LGTM, with one small question.



================
Comment at: lib/Transforms/InstCombine/InstCombineShifts.cpp:518
+      if (isLeftShift && Op0BO->getOpcode() == Instruction::Sub &&
+          match(Op0BO->getOperand(0), m_APInt(Op0C))) {
+        Constant *NewRHS = ConstantExpr::get(I.getOpcode(),
----------------
It looks like this can match a vector?  If it can, please add a vector testcase.


https://reviews.llvm.org/D36443





More information about the llvm-commits mailing list