From 56d7bc03dd465434eef03ac6f86e9f4e4ae1ca6a Mon Sep 17 00:00:00 2001 From: Andreas Bolka Date: Thu, 30 Jul 2009 02:26:01 +0000 Subject: [PATCH] Equal SCEVs of a subscript give rise to dependence. llvm-svn: 77570 --- lib/Analysis/LoopDependenceAnalysis.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp index 51f6c3aafd9..0c8bbd7a568 100644 --- a/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/lib/Analysis/LoopDependenceAnalysis.cpp @@ -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