summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-20 22:34:45 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-20 22:34:45 +0000
commitf7638e1e51e437cd7f889731fe0cce0abd131ea0 (patch)
tree8d14321d9b0dc82652a8dd18790986a2d31c0582 /llvm
parent6800ab437c8aaf7373a1ee5fa8dc1a5e3c48746e (diff)
downloadbcm5719-llvm-f7638e1e51e437cd7f889731fe0cce0abd131ea0.tar.gz
bcm5719-llvm-f7638e1e51e437cd7f889731fe0cce0abd131ea0.zip
Simplify max/minp[s|d] dagcombine matching
llvm-svn: 140199
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index c21b1dcc243..a2b5d046281 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -12562,17 +12562,14 @@ static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
// Get the LHS/RHS of the select.
SDValue LHS = N->getOperand(1);
SDValue RHS = N->getOperand(2);
+ EVT VT = LHS.getValueType();
// If we have SSE[12] support, try to form min/max nodes. SSE min/max
// instructions match the semantics of the common C idiom x<y?x:y but not
// x<=y?x:y, because of how they handle negative zero (which can be
// ignored in unsafe-math mode).
- if (Cond.getOpcode() == ISD::SETCC &&
- ((Subtarget->hasXMMInt() &&
- (LHS.getValueType() == MVT::f32 || LHS.getValueType() == MVT::v4f32 ||
- LHS.getValueType() == MVT::f64 || LHS.getValueType() == MVT::v2f64)) ||
- (Subtarget->hasAVX() &&
- (LHS.getValueType() == MVT::v8f32 || LHS.getValueType() == MVT::v4f64)))) {
+ if (Cond.getOpcode() == ISD::SETCC && VT.isFloatingPoint() &&
+ VT != MVT::f80 && DAG.getTargetLoweringInfo().isTypeLegal(VT)) {
ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get();
unsigned Opcode = 0;
OpenPOWER on IntegriCloud