Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 85eba18

Browse files
committed
[X86] Fix some 'return SDValue()' after DCI.CombineTo instead return the output of CombineTo
Returning SDValue() means nothing was changed. Returning the result of CombineTo returns the first argument of CombineTo. This is specially detected by DAGCombiner as meaning that something changed, but worklist management was already taken care of. I think the only real effect of this change is that we now properly update the Statistic the counts the number of combines performed. That's the only thing between the check for null and the check for N in the DAGCombiner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337491 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a34dfe6 commit 85eba18

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

lib/Target/X86/X86ISelLowering.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31291,8 +31291,7 @@ static SDValue combineShuffle(SDNode *N, SelectionDAG &DAG,
3129131291
if (SDValue Res = combineX86ShufflesRecursively(
3129231292
{Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3129331293
/*HasVarMask*/ false, DAG, Subtarget)) {
31294-
DCI.CombineTo(N, Res);
31295-
return SDValue();
31294+
return DCI.CombineTo(N, Res);
3129631295
}
3129731296
}
3129831297

@@ -33969,7 +33968,7 @@ static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
3396933968

3397033969
if (NewMul)
3397133970
// Do not add new nodes to DAG combiner worklist.
33972-
DCI.CombineTo(N, NewMul, false);
33971+
return DCI.CombineTo(N, NewMul, false);
3397333972

3397433973
return SDValue();
3397533974
}
@@ -34230,8 +34229,7 @@ static SDValue combineVectorPack(SDNode *N, SelectionDAG &DAG,
3423034229
if (SDValue Res =
3423134230
combineX86ShufflesRecursively({Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3423234231
/*HasVarMask*/ false, DAG, Subtarget)) {
34233-
DCI.CombineTo(N, Res);
34234-
return SDValue();
34232+
return DCI.CombineTo(N, Res);
3423534233
}
3423634234

3423734235
return SDValue();
@@ -34292,8 +34290,7 @@ static SDValue combineVectorShiftImm(SDNode *N, SelectionDAG &DAG,
3429234290
if (SDValue Res = combineX86ShufflesRecursively(
3429334291
{Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3429434292
/*HasVarMask*/ false, DAG, Subtarget)) {
34295-
DCI.CombineTo(N, Res);
34296-
return SDValue();
34293+
return DCI.CombineTo(N, Res);
3429734294
}
3429834295
}
3429934296

@@ -34333,8 +34330,7 @@ static SDValue combineVectorInsert(SDNode *N, SelectionDAG &DAG,
3433334330
if (SDValue Res =
3433434331
combineX86ShufflesRecursively({Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3433534332
/*HasVarMask*/ false, DAG, Subtarget)) {
34336-
DCI.CombineTo(N, Res);
34337-
return SDValue();
34333+
return DCI.CombineTo(N, Res);
3433834334
}
3433934335

3434034336
return SDValue();
@@ -34790,8 +34786,7 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
3479034786
if (SDValue Res = combineX86ShufflesRecursively(
3479134787
{Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3479234788
/*HasVarMask*/ false, DAG, Subtarget)) {
34793-
DCI.CombineTo(N, Res);
34794-
return SDValue();
34789+
return DCI.CombineTo(N, Res);
3479534790
}
3479634791
}
3479734792

@@ -37201,8 +37196,7 @@ static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG,
3720137196
if (SDValue Res = combineX86ShufflesRecursively(
3720237197
{Op}, 0, Op, {0}, {}, /*Depth*/ 1,
3720337198
/*HasVarMask*/ false, DAG, Subtarget)) {
37204-
DCI.CombineTo(N, Res);
37205-
return SDValue();
37199+
return DCI.CombineTo(N, Res);
3720637200
}
3720737201
}
3720837202

0 commit comments

Comments
 (0)