Somehow I lost a condition when I was shuffling some code around. Anyway,
authorEvan Cheng <evan.cheng@apple.com>
Tue, 30 May 2006 22:13:36 +0000 (22:13 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 30 May 2006 22:13:36 +0000 (22:13 +0000)
only transform a shufps to pshufd when the first two operands are the same.

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

lib/Target/X86/X86InstrInfo.cpp

index 71504f94d026e00ddf45b8b4dbba70e15a1a8634..47388eae48363b7ca5054fd93b1df1da9467c13c 100644 (file)
@@ -125,11 +125,11 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const {
   case X86::SHUFPSrri: {
     assert(MI->getNumOperands() == 4 && "Unknown shufps instruction!");
     const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
-    if (!Subtarget->hasSSE2()) return 0;
     unsigned A = MI->getOperand(0).getReg();
     unsigned B = MI->getOperand(1).getReg();
     unsigned C = MI->getOperand(2).getReg();
     unsigned M = MI->getOperand(3).getImmedValue();
+    if (!Subtarget->hasSSE2() || B != C) return 0;
     return BuildMI(X86::PSHUFDri, 2, A).addReg(B).addImm(M);
   }
   }