[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.

llvm-svn: 356978
This commit is contained in:
Craig Topper 2019-03-26 05:12:23 +00:00
parent 795ebe3bff
commit 10576fea82
1 changed files with 1 additions and 1 deletions

View File

@ -3086,7 +3086,7 @@ bool X86DAGToDAGISel::matchBitExtract(SDNode *Node) {
// The 'X' was originally truncated. Do that now. // The 'X' was originally truncated. Do that now.
if (XVT != NVT) { if (XVT != NVT) {
insertDAGNode(*CurDAG, OrigNBits, Extract); insertDAGNode(*CurDAG, SDValue(Node, 0), Extract);
Extract = CurDAG->getNode(ISD::TRUNCATE, DL, NVT, Extract); Extract = CurDAG->getNode(ISD::TRUNCATE, DL, NVT, Extract);
} }