From a7a130cbf7151e8b027c36ec34e9ef4cc6037bc8 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 20 Jul 2018 17:57:42 +0000 Subject: [PATCH] [X86] Remove what appear to be unnecessary uses of DCI.CombineTo CombineTo is most useful when you need to replace multiple results, avoid the worklist management, or you need to something else after the combine, etc. Otherwise you should be able to just return the new node and let DAGCombiner go through its usual worklist code. All of the places changed in this patch look to be standard cases where we should be able to use the more stand behavior of just returning the new node. Differential Revision: https://reviews.llvm.org/D49569 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337589 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 32 ++++++++++++------------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 9543b6429a4..ad571cd8f4a 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -30830,7 +30830,7 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG, // Nuke no-op shuffles that show up after combining. if (isNoopShuffleMask(Mask)) - return DCI.CombineTo(N.getNode(), N.getOperand(0), /*AddTo*/ true); + return N.getOperand(0); // Look for simplifications involving one or two shuffle instructions. SDValue V = N.getOperand(0); @@ -31286,9 +31286,8 @@ static SDValue combineShuffle(SDNode *N, SelectionDAG &DAG, // a particular chain. if (SDValue Res = combineX86ShufflesRecursively( {Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; } return SDValue(); @@ -34259,9 +34258,8 @@ static SDValue combineVectorPack(SDNode *N, SelectionDAG &DAG, SDValue Op(N, 0); if (SDValue Res = combineX86ShufflesRecursively({Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; return SDValue(); } @@ -34320,9 +34318,8 @@ static SDValue combineVectorShiftImm(SDNode *N, SelectionDAG &DAG, SDValue Op(N, 0); if (SDValue Res = combineX86ShufflesRecursively( {Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; } // Constant Folding. @@ -34360,9 +34357,8 @@ static SDValue combineVectorInsert(SDNode *N, SelectionDAG &DAG, SDValue Op(N, 0); if (SDValue Res = combineX86ShufflesRecursively({Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; return SDValue(); } @@ -34816,9 +34812,8 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG, SDValue Op(N, 0); if (SDValue Res = combineX86ShufflesRecursively( {Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; } // Attempt to combine a scalar bitmask AND with an extracted shuffle. @@ -37226,9 +37221,8 @@ static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG, SDValue Op(N, 0); if (SDValue Res = combineX86ShufflesRecursively( {Op}, 0, Op, {0}, {}, /*Depth*/ 1, - /*HasVarMask*/ false, DAG, Subtarget)) { - return DCI.CombineTo(N, Res); - } + /*HasVarMask*/ false, DAG, Subtarget)) + return Res; } return SDValue(); -- 2.50.1