Skip to content

Commit 74f5327

Browse files
Update LegalizeVectorOps.cpp
1 parent 14d036a commit 74f5327

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,18 +1779,17 @@ void VectorLegalizer::ExpandUINT_TO_FLOAT(SDNode *Node,
17791779

17801780
// If STRICT_/FMUL is not supported by the target (in case of f16) replace the
17811781
// UINT_TO_FP with a larger float and round to the smaller type
1782-
if ((!IsStrict && TLI.getOperationAction(ISD::FMUL, Node->getValueType(0)) ==
1783-
TargetLowering::Expand) ||
1784-
(IsStrict &&
1785-
TLI.getOperationAction(ISD::STRICT_FMUL, Node->getValueType(0)) ==
1786-
TargetLowering::Expand)) {
1782+
if ((!IsStrict &&
1783+
TLI.getOperationAction(ISD::FMUL, DstVT) == TargetLowering::Expand) ||
1784+
(IsStrict && TLI.getOperationAction(ISD::STRICT_FMUL, DstVT) ==
1785+
TargetLowering::Expand)) {
17871786
EVT FPVT = BW == 32 ? MVT::f32 : MVT::f64;
17881787
SDLoc DL(Node);
17891788
unsigned Round = IsStrict ? ISD::STRICT_FP_ROUND : ISD::FP_ROUND;
17901789
unsigned UIToFP = IsStrict ? ISD::STRICT_UINT_TO_FP : ISD::UINT_TO_FP;
17911790
SDValue Result = DAG.getNode(
1792-
Round, DL, Node->getValueType(0),
1793-
DAG.getNode(UIToFP, DL, VT.changeVectorElementType(FPVT), Src),
1791+
Round, DL, DstVT,
1792+
DAG.getNode(UIToFP, DL, SrcVT.changeVectorElementType(FPVT), Src),
17941793
DAG.getTargetConstant(
17951794
0, DL,
17961795
DAG.getTargetLoweringInfo().getPointerTy(DAG.getDataLayout())));

0 commit comments

Comments
 (0)