From: Craig Topper Date: Tue, 26 Mar 2019 05:12:23 +0000 (+0000) Subject: [X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f2a0d18473d7911e174a7589bff56f5b4876258;p=llvm [X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR at Node's position in the DAG for the topological sort. We were using OrigNBits, but that doesn't guarantee that it will be selected before the nodes that make up X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356978 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 4cf7b02a24c..38c1c6ba8d0 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -3086,7 +3086,7 @@ bool X86DAGToDAGISel::matchBitExtract(SDNode *Node) { // The 'X' was originally truncated. Do that now. if (XVT != NVT) { - insertDAGNode(*CurDAG, OrigNBits, Extract); + insertDAGNode(*CurDAG, SDValue(Node, 0), Extract); Extract = CurDAG->getNode(ISD::TRUNCATE, DL, NVT, Extract); }