[llvm-branch-commits] [llvm-branch] r96991 - /llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp

Evan Cheng evan.cheng at apple.com
Tue Feb 23 13:58:25 PST 2010


Author: evancheng
Date: Tue Feb 23 15:58:25 2010
New Revision: 96991

URL: http://llvm.org/viewvc/llvm-project?rev=96991&view=rev
Log:
Merge 96990.

Modified:
    llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp?rev=96991&r1=96990&r2=96991&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Target/X86/X86ISelLowering.cpp Tue Feb 23 15:58:25 2010
@@ -9154,9 +9154,10 @@
 }
 
 /// PerformANDCombine - Look for SSE and instructions of this form:
-/// (and x, (build_vector c1,c2,c3,c4)). If there exists a use of a build_vector
-/// that's the bitwise complement of the mask, then transform the node to
-/// (and (xor x, (build_vector -1,-1,-1,-1)), (build_vector ~c1,~c2,~c3,~c4)).
+/// (and x, (build_vector signbit,signbit,signbit,signbit)). If there
+/// exists a use of a build_vector that's the bitwise complement of the mask,
+/// then transform the node to
+/// (and (xor x, (build_vector -1,-1,-1,-1)), (build_vector ~sb,~sb,~sb,~sb)).
 static SDValue PerformANDCombine(SDNode *N, SelectionDAG &DAG,
                                  TargetLowering::DAGCombinerInfo &DCI) {
   EVT VT = N->getValueType(0);
@@ -9180,7 +9181,11 @@
         continue;
       }
       ConstantSDNode *C = dyn_cast<ConstantSDNode>(Arg);
-      if (!C) return SDValue();
+      if (!C)
+        return SDValue();
+      if (!C->getAPIntValue().isSignBit() &&
+          !C->getAPIntValue().isMaxSignedValue())
+        return SDValue();
       Mask.push_back(DAG.getConstant(~C->getAPIntValue(), EltVT));
     }
     N1 = DAG.getNode(ISD::BUILD_VECTOR, N1.getDebugLoc(), VT,





More information about the llvm-branch-commits mailing list