@@ -507,7 +507,7 @@ namespace {
507507 SDValue visitUINT_TO_FP(SDNode *N);
508508 SDValue visitFP_TO_SINT(SDNode *N);
509509 SDValue visitFP_TO_UINT(SDNode *N);
510- SDValue visitXRINT (SDNode *N);
510+ SDValue visitXROUND (SDNode *N);
511511 SDValue visitFP_ROUND(SDNode *N);
512512 SDValue visitFP_EXTEND(SDNode *N);
513513 SDValue visitFNEG(SDNode *N);
@@ -1929,8 +1929,10 @@ SDValue DAGCombiner::visit(SDNode *N) {
19291929 case ISD::UINT_TO_FP: return visitUINT_TO_FP(N);
19301930 case ISD::FP_TO_SINT: return visitFP_TO_SINT(N);
19311931 case ISD::FP_TO_UINT: return visitFP_TO_UINT(N);
1932+ case ISD::LROUND:
1933+ case ISD::LLROUND:
19321934 case ISD::LRINT:
1933- case ISD::LLRINT: return visitXRINT (N);
1935+ case ISD::LLRINT: return visitXROUND (N);
19341936 case ISD::FP_ROUND: return visitFP_ROUND(N);
19351937 case ISD::FP_EXTEND: return visitFP_EXTEND(N);
19361938 case ISD::FNEG: return visitFNEG(N);
@@ -17998,15 +18000,17 @@ SDValue DAGCombiner::visitFP_TO_UINT(SDNode *N) {
1799818000 return FoldIntToFPToInt(N, DAG);
1799918001}
1800018002
18001- SDValue DAGCombiner::visitXRINT (SDNode *N) {
18003+ SDValue DAGCombiner::visitXROUND (SDNode *N) {
1800218004 SDValue N0 = N->getOperand(0);
1800318005 EVT VT = N->getValueType(0);
1800418006
1800518007 // fold (lrint|llrint undef) -> undef
18008+ // fold (lround|llround undef) -> undef
1800618009 if (N0.isUndef())
1800718010 return DAG.getUNDEF(VT);
1800818011
1800918012 // fold (lrint|llrint c1fp) -> c1
18013+ // fold (lround|llround c1fp) -> c1
1801018014 if (DAG.isConstantFPBuildVectorOrConstantFP(N0))
1801118015 return DAG.getNode(N->getOpcode(), SDLoc(N), VT, N0);
1801218016
0 commit comments