Use the right induction variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97541 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index e62e559..c0b0d72 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1680,8 +1680,8 @@
     // that are not part of the pattern we're matching.
     for (unsigned op = 0, e = N->getNumOperands(); op != e; ++op) {
       if (!std::count(ChainNodesMatched.begin(), ChainNodesMatched.end(),
-                      N->getOperand(i).getNode()))
-        InputChains.push_back(N->getOperand(i));
+                      N->getOperand(op).getNode()))
+        InputChains.push_back(N->getOperand(op));
     }
   }