summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-02-23 21:51:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-02-23 21:51:54 +0000
commitda52f449a06f568bd76c5c8ad89862d0b525cd6c (patch)
tree634b884f5142ac228877e23b53ff2b79230c8b1b
parentfc83aa04dbebe920741cf3a18cf4a70776d4dbee (diff)
downloadbcm5719-llvm-da52f449a06f568bd76c5c8ad89862d0b525cd6c.tar.gz
bcm5719-llvm-da52f449a06f568bd76c5c8ad89862d0b525cd6c.zip
Fix rev 96389 by restricting the xform to mask that's either signbit or max signed value.
llvm-svn: 96990
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 97277317604..d59c1a82e2f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -9092,9 +9092,10 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
}
/// 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);
@@ -9118,7 +9119,11 @@ static SDValue PerformANDCombine(SDNode *N, SelectionDAG &DAG,
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,
OpenPOWER on IntegriCloud