[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

Evan Cheng evan.cheng at apple.com
Sat Apr 22 23:35:31 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.183 -> 1.184
---
Log message:

MOVL shuffle (i.e. movd or movss / movsd from memory) of undef, V2 == V2

---
Diffs of the changes:  (+7 -2)

 X86ISelLowering.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.183 llvm/lib/Target/X86/X86ISelLowering.cpp:1.184
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.183	Sat Apr 22 13:53:45 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Sun Apr 23 01:35:19 2006
@@ -2973,6 +2973,8 @@
     SDOperand PermMask = Op.getOperand(2);
     MVT::ValueType VT = Op.getValueType();
     unsigned NumElems = PermMask.getNumOperands();
+    bool V1IsUndef = V1.getOpcode() == ISD::UNDEF;
+    bool V2IsUndef = V2.getOpcode() == ISD::UNDEF;
 
     if (isSplatMask(PermMask.Val)) {
       if (NumElems <= 4) return Op;
@@ -2980,8 +2982,10 @@
       return PromoteSplat(Op, DAG);
     }
 
-    if (X86::isMOVLMask(PermMask.Val) ||
-        X86::isMOVSHDUPMask(PermMask.Val) ||
+    if (X86::isMOVLMask(PermMask.Val))
+      return (V1IsUndef) ? V2 : Op;
+      
+    if (X86::isMOVSHDUPMask(PermMask.Val) ||
         X86::isMOVSLDUPMask(PermMask.Val) ||
         X86::isMOVHLPSMask(PermMask.Val) ||
         X86::isMOVHPMask(PermMask.Val) ||
@@ -3003,6 +3007,7 @@
     }
 
     if (isCommutedMOVL(PermMask.Val, V2IsSplat)) {
+      if (V2IsUndef) return V1;
       Op = CommuteVectorShuffle(Op, DAG);
       V1 = Op.getOperand(0);
       V2 = Op.getOperand(1);






More information about the llvm-commits mailing list