Equal SCEVs of a subscript give rise to dependence.
authorAndreas Bolka <a@bolka.at>
Thu, 30 Jul 2009 02:26:01 +0000 (02:26 +0000)
committerAndreas Bolka <a@bolka.at>
Thu, 30 Jul 2009 02:26:01 +0000 (02:26 +0000)
llvm-svn: 77570

llvm/lib/Analysis/LoopDependenceAnalysis.cpp

index 51f6c3a..0c8bbd7 100644 (file)
@@ -127,7 +127,17 @@ LoopDependenceAnalysis::DependenceResult
 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