diff options
| author | Craig Topper <craig.topper@gmail.com> | 2019-11-16 22:08:53 -0800 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2019-11-17 13:31:30 -0800 |
| commit | 1b0efe2b1778e821aade88667b1cb82d1c93f7e9 (patch) | |
| tree | 543d65a04a2af579690121074b3d656537767dc0 /llvm/lib/CodeGen | |
| parent | 9b515b6dd919cbd67ba12c01530708c5617e288f (diff) | |
| download | bcm5719-llvm-1b0efe2b1778e821aade88667b1cb82d1c93f7e9.tar.gz bcm5719-llvm-1b0efe2b1778e821aade88667b1cb82d1c93f7e9.zip | |
[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.
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index da822e2d075..d8e04e9b435 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -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); } |

