[llvm] r336925 - [X86] Connect the flags user from PCMPISTR instructions to the correct node from the instruction.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 11:04:05 PDT 2018


Author: ctopper
Date: Thu Jul 12 11:04:05 2018
New Revision: 336925

URL: http://llvm.org/viewvc/llvm-project?rev=336925&view=rev
Log:
[X86] Connect the flags user from PCMPISTR instructions to the correct node from the instruction.

We were accidentally connecting it to result 0 instead of result 1. This was caught by the machine verifier that noticed the flags were dead, but we were using them somehow. I'm still not clear what actually happened downstream.

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=336925&r1=336924&r2=336925&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Jul 12 11:04:05 2018
@@ -3336,7 +3336,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
     }
 
     // Connect the flag usage to the last instruction created.
-    ReplaceUses(SDValue(Node, 2), SDValue(CNode, 0));
+    ReplaceUses(SDValue(Node, 2), SDValue(CNode, 1));
     CurDAG->RemoveDeadNode(Node);
     return;
   }




More information about the llvm-commits mailing list