[llvm] r356978 - [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.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 22:12:23 PDT 2019


Author: ctopper
Date: Mon Mar 25 22:12:23 2019
New Revision: 356978

URL: http://llvm.org/viewvc/llvm-project?rev=356978&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=356978&r1=356977&r2=356978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Mar 25 22:12:23 2019
@@ -3086,7 +3086,7 @@ bool X86DAGToDAGISel::matchBitExtract(SD
 
   // 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);
   }
 




More information about the llvm-commits mailing list