From: Craig Topper Date: Tue, 2 Jun 2020 04:53:19 +0000 (-0700) Subject: [X86] Fix a few recursivelyDeleteUnusedNodes calls that were trying to delete nodes... X-Git-Tag: llvmorg-12-init~4463 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e51d5bc7a4fc967c8a99a75cfa9480eb6b3a4fae;p=platform%2Fupstream%2Fllvm.git [X86] Fix a few recursivelyDeleteUnusedNodes calls that were trying to delete nodes before their user was really gone. We looked through a truncate to get to the load. So we should be deleting the truncate first. There is a check that the node is really unused before deleting so this didn't cause a functional issue. --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 86825ce..5cf1a94 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -35705,7 +35705,7 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG, LN->getMemOperand()->getFlags()); DCI.CombineTo(N.getNode(), BcastLd); DAG.ReplaceAllUsesOfValueWith(SDValue(LN, 1), BcastLd.getValue(1)); - DCI.recursivelyDeleteUnusedNodes(LN); + DCI.recursivelyDeleteUnusedNodes(Src.getNode()); return N; // Return N so it doesn't get rechecked! } } @@ -35722,7 +35722,7 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG, LN->getMemoryVT(), LN->getMemOperand()); DCI.CombineTo(N.getNode(), BcastLd); DAG.ReplaceAllUsesOfValueWith(SDValue(LN, 1), BcastLd.getValue(1)); - DCI.recursivelyDeleteUnusedNodes(LN); + DCI.recursivelyDeleteUnusedNodes(Src.getNode()); return N; // Return N so it doesn't get rechecked! } } @@ -35750,7 +35750,7 @@ static SDValue combineTargetShuffle(SDValue N, SelectionDAG &DAG, LN->getMemOperand()->getFlags()); DCI.CombineTo(N.getNode(), BcastLd); DAG.ReplaceAllUsesOfValueWith(SDValue(LN, 1), BcastLd.getValue(1)); - DCI.recursivelyDeleteUnusedNodes(LN); + DCI.recursivelyDeleteUnusedNodes(Src.getNode()); return N; // Return N so it doesn't get rechecked! } }