forked from OSchip/llvm-project
[X86] Use isScalarFPTypeInSSEReg to simplify code in LowerSELECT. NFC
This commit is contained in:
parent
ac1ea0d3da
commit
b0840934a7
|
@ -22391,9 +22391,7 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
|
|||
// Lower FP selects into a CMP/AND/ANDN/OR sequence when the necessary SSE ops
|
||||
// are available or VBLENDV if AVX is available.
|
||||
// Otherwise FP cmovs get lowered into a less efficient branch sequence later.
|
||||
if (Cond.getOpcode() == ISD::SETCC &&
|
||||
((Subtarget.hasSSE2() && VT == MVT::f64) ||
|
||||
(Subtarget.hasSSE1() && VT == MVT::f32)) &&
|
||||
if (Cond.getOpcode() == ISD::SETCC && isScalarFPTypeInSSEReg(VT) &&
|
||||
VT == Cond.getOperand(0).getSimpleValueType() && Cond->hasOneUse()) {
|
||||
SDValue CondOp0 = Cond.getOperand(0), CondOp1 = Cond.getOperand(1);
|
||||
bool IsAlwaysSignaling;
|
||||
|
@ -22449,7 +22447,7 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
|
|||
}
|
||||
|
||||
// AVX512 fallback is to lower selects of scalar floats to masked moves.
|
||||
if ((VT == MVT::f64 || VT == MVT::f32) && Subtarget.hasAVX512()) {
|
||||
if (isScalarFPTypeInSSEReg(VT) && Subtarget.hasAVX512()) {
|
||||
SDValue Cmp = DAG.getNode(ISD::SCALAR_TO_VECTOR, DL, MVT::v1i1, Cond);
|
||||
return DAG.getNode(X86ISD::SELECTS, DL, VT, Cmp, Op1, Op2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue