From 713395950a615b2fb932fc25a6723612ca09b23c 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77570 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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