Oops. Bad typo. Without the check of N1.hasOneUse() bad things can happen.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 1 Sep 2006 22:52:28 +0000 (22:52 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 1 Sep 2006 22:52:28 +0000 (22:52 +0000)
Suppose the TokenFactor can reach the Op:

       [Load chain]
           ^
           |
         [Load]
         ^    ^
         |    |
        /      \-
       /         |
      /          [Op]
     /          ^ ^
     |        ..  |
     |       /    |
   [TokenFactor]  |
       ^          |
       |          |
        \        /
         \      /
         [Store]

If we move the Load below the TokenFactor, we would have created a cycle in
the DAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30040 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelDAGToDAG.cpp

index 3322f8847a02001c4d1ec49c8e39b79a815a0ef0..c5ffb06feec0c40837b55230298b59590258a6c0 100644 (file)
@@ -308,8 +308,8 @@ void X86DAGToDAGISel::InstructionSelectPreprocess(SelectionDAG &DAG) {
 
     SDOperand N1 = I->getOperand(1);
     SDOperand N2 = I->getOperand(2);
-    if (MVT::isFloatingPoint(N1.getValueType()) &&
-        MVT::isVector(N1.getValueType()) &&
+    if (MVT::isFloatingPoint(N1.getValueType()) ||
+        MVT::isVector(N1.getValueType()) ||
         !N1.hasOneUse())
       continue;