[PATCH] D32863: InstructionSimplify: Relanding r301766

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 7 08:21:04 PDT 2017


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

LGTM.



================
Comment at: lib/Analysis/InstructionSimplify.cpp:4087-4088
+
+  // Canonicalization: if only one input vector is constant, it shall be the
+  // second one.
+  if (Op0Const && !Op1Const) {
----------------
zvi wrote:
> spatel wrote:
> > Is the plan to actually do this canonicalization of constant to 2nd operand in InstCombine? If so, wouldn't it make sense to add a "commute" or "commuteMask" (this is what it's called in the DAG) function directly to ShuffleVectorInst and then use that here?
> Sounds good. How about we do this as a follow-up patch?
Sure - I just want to avoid having multiple copies of this code. If we can unify this somewhere for IR and the DAG that would be even better.


https://reviews.llvm.org/D32863





More information about the llvm-commits mailing list