]> granicus.if.org Git - llvm/commitdiff
[X86,ISEL] Fix X86 increment chain dependence calculation
authorNirav Dave <niravd@google.com>
Thu, 2 Feb 2017 14:39:26 +0000 (14:39 +0000)
committerNirav Dave <niravd@google.com>
Thu, 2 Feb 2017 14:39:26 +0000 (14:39 +0000)
Merging Load-add-store pattern into a increment op previously dropped
the load's chain from the instructions dependence if the store is
chained to a TokenFactor.

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

lib/Target/X86/X86ISelDAGToDAG.cpp

index 8ab4c0616880c6ebf3bb43d0b96dac5505640ef6..7f08d2dea9dc6f3e4140e965c192432bfa282ed2 100644 (file)
@@ -1905,6 +1905,8 @@ static bool isLoadIncOrDecStore(StoreSDNode *StoreNode, unsigned Opc,
       SDValue Op = Chain.getOperand(i);
       if (Op == Load.getValue(1)) {
         ChainCheck = true;
+        // Drop Load, but keep its chain. No cycle check necessary.
+        ChainOps.push_back(Load.getOperand(0));
         continue;
       }