]> granicus.if.org Git - llvm/commitdiff
[X86][SSE] Set second operand to undef instead of first operand in unary shuffle...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 28 Mar 2017 12:16:42 +0000 (12:16 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 28 Mar 2017 12:16:42 +0000 (12:16 +0000)
Copy isn't necessary after the matchVectorShuffleWithUNPCK refactor and undef value will make some future undef/zero handling easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298910 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 94b24017ecec660d4b2b36d59459fee823fbddd4..74a8fb189ace61b8bac82f2e4c7f47ffe60b3c4d 100644 (file)
@@ -27269,7 +27269,8 @@ static bool combineX86ShuffleChain(ArrayRef<SDValue> Inputs, SDValue Root,
   // here, we're not going to remove the operands we find.
   bool UnaryShuffle = (Inputs.size() == 1);
   SDValue V1 = peekThroughBitcasts(Inputs[0]);
-  SDValue V2 = (UnaryShuffle ? V1 : peekThroughBitcasts(Inputs[1]));
+  SDValue V2 = (UnaryShuffle ? DAG.getUNDEF(V1.getValueType())
+                             : peekThroughBitcasts(Inputs[1]));
 
   MVT VT1 = V1.getSimpleValueType();
   MVT VT2 = V2.getSimpleValueType();