[LegalizeTypes] When expanding the integer result of LLROUND/LLRINT, also call GetSoftenedFloat if the floating point input needs to be softened.

Before this we were emitting a bitcast to integer from the lowering
code that itself will need to be legalized. By calling
GetSoftenedFloat we get the integer conversion in one step without
needing to relegalize a bitcast.
This commit is contained in:
Craig Topper 2019-11-16 22:08:53 -08:00
parent 9b515b6dd9
commit 1b0efe2b17
1 changed files with 6 additions and 0 deletions

View File

@ -2625,6 +2625,12 @@ void DAGTypeLegalizer::ExpandIntRes_LLROUND_LLRINT(SDNode *N, SDValue &Lo,
EVT RetVT = N->getValueType(0);
TargetLowering::MakeLibCallOptions CallOptions;
CallOptions.setSExt(true);
if (getTypeAction(VT) == TargetLowering::TypeSoftenFloat) {
Op = GetSoftenedFloat(Op);
CallOptions.setTypeListBeforeSoften(VT, RetVT, true);
}
SplitInteger(TLI.makeLibCall(DAG, LC, RetVT, Op, CallOptions, dl).first,
Lo, Hi);
}