[llvm] 2485fa7 - [LegalizeTypes] Use SoftenFloatRes_Unary in SoftenFloatRes_FCBRT to reduce code.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 28 15:47:49 PST 2019
Author: Craig Topper
Date: 2019-11-28T15:30:34-08:00
New Revision: 2485fa7739c7ecda629b51f9936457e2aaee2420
URL: https://github.com/llvm/llvm-project/commit/2485fa7739c7ecda629b51f9936457e2aaee2420
DIFF: https://github.com/llvm/llvm-project/commit/2485fa7739c7ecda629b51f9936457e2aaee2420.diff
LOG: [LegalizeTypes] Use SoftenFloatRes_Unary in SoftenFloatRes_FCBRT to reduce code.
We don't have a STRICT_CBRT ISD opcode, but we can still
use SoftenFloatRes_Unary to simplify some code.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 582ec001cc71..c1b2f8edcdb9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -267,18 +267,12 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FADD(SDNode *N) {
}
SDValue DAGTypeLegalizer::SoftenFloatRes_FCBRT(SDNode *N) {
- EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
- SDValue Op = GetSoftenedFloat(N->getOperand(0));
- TargetLowering::MakeLibCallOptions CallOptions;
- EVT OpsVT[1] = { N->getOperand(0).getValueType() };
- CallOptions.setTypeListBeforeSoften(OpsVT, N->getValueType(0), true);
- return TLI.makeLibCall(DAG, GetFPLibCall(N->getValueType(0),
+ return SoftenFloatRes_Unary(N, GetFPLibCall(N->getValueType(0),
RTLIB::CBRT_F32,
RTLIB::CBRT_F64,
RTLIB::CBRT_F80,
RTLIB::CBRT_F128,
- RTLIB::CBRT_PPCF128),
- NVT, Op, CallOptions, SDLoc(N)).first;
+ RTLIB::CBRT_PPCF128));
}
SDValue DAGTypeLegalizer::SoftenFloatRes_FCEIL(SDNode *N) {
More information about the llvm-commits
mailing list