Skip to content

Commit f406d83

Browse files
committed
[DAG] widenCtPop - reuse existing SDLoc. NFC.
1 parent ef2af7f commit f406d83

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13782,9 +13782,10 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
1378213782
/// Given an extending node with a pop-count operand, if the target does not
1378313783
/// support a pop-count in the narrow source type but does support it in the
1378413784
/// 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) {
1378613786
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");
1378813789

1378913790
SDValue CtPop = Extend->getOperand(0);
1379013791
if (CtPop.getOpcode() != ISD::CTPOP || !CtPop.hasOneUse())
@@ -13797,7 +13798,6 @@ static SDValue widenCtPop(SDNode *Extend, SelectionDAG &DAG) {
1379713798
return SDValue();
1379813799

1379913800
// zext (ctpop X) --> ctpop (zext X)
13800-
SDLoc DL(Extend);
1380113801
SDValue NewZext = DAG.getZExtOrTrunc(CtPop.getOperand(0), DL, VT);
1380213802
return DAG.getNode(ISD::CTPOP, DL, VT, NewZext);
1380313803
}
@@ -14138,7 +14138,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
1413814138
if (SDValue NewVSel = matchVSelectOpSizesWithSetCC(N))
1413914139
return NewVSel;
1414014140

14141-
if (SDValue NewCtPop = widenCtPop(N, DAG))
14141+
if (SDValue NewCtPop = widenCtPop(N, DAG, DL))
1414214142
return NewCtPop;
1414314143

1414414144
if (SDValue V = widenAbs(N, DAG))
@@ -14316,7 +14316,7 @@ SDValue DAGCombiner::visitANY_EXTEND(SDNode *N) {
1431614316
return SCC;
1431714317
}
1431814318

14319-
if (SDValue NewCtPop = widenCtPop(N, DAG))
14319+
if (SDValue NewCtPop = widenCtPop(N, DAG, DL))
1432014320
return NewCtPop;
1432114321

1432214322
if (SDValue Res = tryToFoldExtendSelectLoad(N, TLI, DAG, DL, Level))

0 commit comments

Comments
 (0)