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

Evan Cheng evan.cheng at apple.com
Sat Apr 22 01:34:17 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.181 -> 1.182
---
Log message:

Don't do all the lowering stuff for 2-wide build_vector's. Also, minor optimization for shuffle of undef.

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

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


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.181 llvm/lib/Target/X86/X86ISelLowering.cpp:1.182
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.181	Sat Apr 22 01:21:46 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Sat Apr 22 03:34:05 2006
@@ -2977,8 +2977,8 @@
         ShouldXformToMOVLP(V1.Val, PermMask.Val))
       return CommuteVectorShuffle(Op, DAG);
 
-    bool V1IsSplat = isSplatVector(V1.Val);
-    bool V2IsSplat = isSplatVector(V2.Val);
+    bool V1IsSplat = isSplatVector(V1.Val) || V1.getOpcode() == ISD::UNDEF;
+    bool V2IsSplat = isSplatVector(V2.Val) || V2.getOpcode() == ISD::UNDEF;
     if (V1IsSplat && !V2IsSplat) {
       Op = CommuteVectorShuffle(Op, DAG);
       V1 = Op.getOperand(0);
@@ -3137,6 +3137,9 @@
       return Op;
 
     unsigned NumElems = Op.getNumOperands();
+    if (NumElems == 2)
+      return SDOperand();
+
     unsigned Half = NumElems/2;
     MVT::ValueType VT = Op.getValueType();
     MVT::ValueType EVT = MVT::getVectorBaseType(VT);






More information about the llvm-commits mailing list