[X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR...
authorCraig Topper <craig.topper@intel.com>
Tue, 26 Mar 2019 05:12:23 +0000 (05:12 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 26 Mar 2019 05:12:23 +0000 (05:12 +0000)
We were using OrigNBits, but that doesn't guarantee that it will be selected before the nodes that make up X.

llvm-svn: 356978

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

index 4cf7b02..38c1c6b 100644 (file)
@@ -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);
   }