aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index f5a54497..c55e55d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -1268,30 +1268,25 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
return;
break;
-
+ case ISD::FSINCOS:
case ISD::FSINCOSPI: {
EVT VT = Node->getValueType(0);
- RTLIB::Libcall LC = RTLIB::getSINCOSPI(VT);
+ RTLIB::Libcall LC = Node->getOpcode() == ISD::FSINCOS
+ ? RTLIB::getSINCOS(VT)
+ : RTLIB::getSINCOSPI(VT);
if (LC != RTLIB::UNKNOWN_LIBCALL &&
- DAG.expandMultipleResultFPLibCall(LC, Node, Results, VT))
+ DAG.expandMultipleResultFPLibCall(LC, Node, Results))
return;
// TODO: Try to see if there's a narrower call available to use before
// scalarizing.
break;
}
- case ISD::FSINCOS: {
- // FIXME: Try to directly match vector case like fsincospi
- EVT VT = Node->getValueType(0).getVectorElementType();
- RTLIB::Libcall LC = RTLIB::getSINCOS(VT);
- if (DAG.expandMultipleResultFPLibCall(LC, Node, Results, VT))
- return;
- break;
- }
case ISD::FMODF: {
- EVT VT = Node->getValueType(0).getVectorElementType();
+ EVT VT = Node->getValueType(0);
RTLIB::Libcall LC = RTLIB::getMODF(VT);
- if (DAG.expandMultipleResultFPLibCall(LC, Node, Results, VT,
+ if (LC != RTLIB::UNKNOWN_LIBCALL &&
+ DAG.expandMultipleResultFPLibCall(LC, Node, Results,
/*CallRetResNo=*/0))
return;
break;