Return the operand rather than a null SDValue when the given SELECT_CC

is actually legal.  Part of LegalizeDAG cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72513 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Friedman 2009-05-28 04:31:08 +00:00
parent e3f1fb1ee8
commit c06441e5ea

View File

@ -2789,12 +2789,12 @@ SDValue PPCTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) {
// Not FP? Not a fsel.
if (!Op.getOperand(0).getValueType().isFloatingPoint() ||
!Op.getOperand(2).getValueType().isFloatingPoint())
return SDValue();
return Op;
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
// Cannot handle SETEQ/SETNE.
if (CC == ISD::SETEQ || CC == ISD::SETNE) return SDValue();
if (CC == ISD::SETEQ || CC == ISD::SETNE) return Op;
MVT ResVT = Op.getValueType();
MVT CmpVT = Op.getOperand(0).getValueType();
@ -2854,7 +2854,7 @@ SDValue PPCTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) {
Cmp = DAG.getNode(ISD::FP_EXTEND, dl, MVT::f64, Cmp);
return DAG.getNode(PPCISD::FSEL, dl, ResVT, Cmp, TV, FV);
}
return SDValue();
return Op;
}
// FIXME: Split this code up when LegalizeDAGTypes lands.