forked from OSchip/llvm-project
[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:
parent
9b515b6dd9
commit
1b0efe2b17
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue