forked from OSchip/llvm-project
[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:
parent
795ebe3bff
commit
10576fea82
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue