1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Simplify max/minp[s|d] dagcombine matching

llvm-svn: 140199
This commit is contained in:
Bruno Cardoso Lopes 2011-09-20 22:34:45 +00:00
parent 296896eb2d
commit 035414367a

View File

@ -12562,17 +12562,14 @@ static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
// Get the LHS/RHS of the select. // Get the LHS/RHS of the select.
SDValue LHS = N->getOperand(1); SDValue LHS = N->getOperand(1);
SDValue RHS = N->getOperand(2); SDValue RHS = N->getOperand(2);
EVT VT = LHS.getValueType();
// If we have SSE[12] support, try to form min/max nodes. SSE min/max // 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 // 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 // x<=y?x:y, because of how they handle negative zero (which can be
// ignored in unsafe-math mode). // ignored in unsafe-math mode).
if (Cond.getOpcode() == ISD::SETCC && if (Cond.getOpcode() == ISD::SETCC && VT.isFloatingPoint() &&
((Subtarget->hasXMMInt() && VT != MVT::f80 && DAG.getTargetLoweringInfo().isTypeLegal(VT)) {
(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)))) {
ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get(); ISD::CondCode CC = cast<CondCodeSDNode>(Cond.getOperand(2))->get();
unsigned Opcode = 0; unsigned Opcode = 0;