@@ -13782,9 +13782,10 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
13782
13782
/// Given an extending node with a pop-count operand, if the target does not
13783
13783
/// support a pop-count in the narrow source type but does support it in the
13784
13784
/// destination type, widen the pop-count to the destination type.
13785
- static SDValue widenCtPop(SDNode *Extend, SelectionDAG &DAG) {
13785
+ static SDValue widenCtPop(SDNode *Extend, SelectionDAG &DAG, const SDLoc &DL ) {
13786
13786
assert((Extend->getOpcode() == ISD::ZERO_EXTEND ||
13787
- Extend->getOpcode() == ISD::ANY_EXTEND) && "Expected extend op");
13787
+ Extend->getOpcode() == ISD::ANY_EXTEND) &&
13788
+ "Expected extend op");
13788
13789
13789
13790
SDValue CtPop = Extend->getOperand(0);
13790
13791
if (CtPop.getOpcode() != ISD::CTPOP || !CtPop.hasOneUse())
@@ -13797,7 +13798,6 @@ static SDValue widenCtPop(SDNode *Extend, SelectionDAG &DAG) {
13797
13798
return SDValue();
13798
13799
13799
13800
// zext (ctpop X) --> ctpop (zext X)
13800
- SDLoc DL(Extend);
13801
13801
SDValue NewZext = DAG.getZExtOrTrunc(CtPop.getOperand(0), DL, VT);
13802
13802
return DAG.getNode(ISD::CTPOP, DL, VT, NewZext);
13803
13803
}
@@ -14138,7 +14138,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
14138
14138
if (SDValue NewVSel = matchVSelectOpSizesWithSetCC(N))
14139
14139
return NewVSel;
14140
14140
14141
- if (SDValue NewCtPop = widenCtPop(N, DAG))
14141
+ if (SDValue NewCtPop = widenCtPop(N, DAG, DL ))
14142
14142
return NewCtPop;
14143
14143
14144
14144
if (SDValue V = widenAbs(N, DAG))
@@ -14316,7 +14316,7 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
14316
14316
return SCC;
14317
14317
}
14318
14318
14319
- if (SDValue NewCtPop = widenCtPop(N, DAG))
14319
+ if (SDValue NewCtPop = widenCtPop(N, DAG, DL ))
14320
14320
return NewCtPop;
14321
14321
14322
14322
if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, DL, Level))
0 commit comments