Equal SCEVs of a subscript give rise to dependence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77570 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp
index 51f6c3a..0c8bbd7 100644
--- a/lib/Analysis/LoopDependenceAnalysis.cpp
+++ b/lib/Analysis/LoopDependenceAnalysis.cpp
@@ -127,7 +127,17 @@
 LoopDependenceAnalysis::analyseSubscript(const SCEV *A,
                                          const SCEV *B,
                                          Subscript *S) const {
-  return Unknown; // TODO: Implement.
+  DEBUG(errs() << "  Testing subscript: " << *A << ", " << *B << "\n");
+
+  if (A == B) {
+    DEBUG(errs() << "  -> [D] same SCEV\n");
+    return Dependent;
+  }
+
+  // TODO: Implement ZIV/SIV/MIV testers.
+
+  DEBUG(errs() << "  -> [?] cannot analyse subscript\n");
+  return Unknown;
 }
 
 LoopDependenceAnalysis::DependenceResult