[PATCH] D31527: InstSimplify: A shuffle of a splat is always the splat itself

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 05:37:23 PDT 2017


RKSimon added inline comments.


================
Comment at: lib/Analysis/InstructionSimplify.cpp:4123
+  if (auto Op0Shuf = dyn_cast<ShuffleVectorInst>(Op0))
+    if (isa<UndefValue>(Op1) && Op0Shuf->getMask()->getSplatValue())
+      return Op0;
----------------
We should only perform this if the result has the same number of elements as the source - please add a type check for RetTy == Op0->getType()


Repository:
  rL LLVM

https://reviews.llvm.org/D31527





More information about the llvm-commits mailing list