diff options
| author | Andreas Bolka <a@bolka.at> | 2009-08-05 04:26:05 +0000 |
|---|---|---|
| committer | Andreas Bolka <a@bolka.at> | 2009-08-05 04:26:05 +0000 |
| commit | 13b860992a82ef5242e74103c1e080dfbd9d860f (patch) | |
| tree | e49d3e871401ffe2bd3d4630100ab751f6411226 /llvm/lib/Analysis/LoopDependenceAnalysis.cpp | |
| parent | cbc7b2654217f514777bba85481319bf3ece86bf (diff) | |
| download | llvm-13b860992a82ef5242e74103c1e080dfbd9d860f.zip llvm-13b860992a82ef5242e74103c1e080dfbd9d860f.tar.gz llvm-13b860992a82ef5242e74103c1e080dfbd9d860f.tar.bz2 | |
ZIV tester for LDA.
llvm-svn: 78157
Diffstat (limited to 'llvm/lib/Analysis/LoopDependenceAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/LoopDependenceAnalysis.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp index 5d593a9..10a6a8e 100644 --- a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp @@ -136,6 +136,19 @@ bool LoopDependenceAnalysis::isAffine(const SCEV *S) const { return isLoopInvariant(S) || (rec && rec->isAffine()); } +bool LoopDependenceAnalysis::isZIVPair(const SCEV *A, const SCEV *B) const { + return isLoopInvariant(A) && isLoopInvariant(B); +} + +LoopDependenceAnalysis::DependenceResult +LoopDependenceAnalysis::analyseZIV(const SCEV *A, + const SCEV *B, + Subscript *S) const { + assert(isZIVPair(A, B)); + const SCEV *diff = SE->getMinusSCEV(A, B); + return diff->isZero() ? Dependent : Independent; +} + LoopDependenceAnalysis::DependenceResult LoopDependenceAnalysis::analyseSubscript(const SCEV *A, const SCEV *B, @@ -152,7 +165,10 @@ LoopDependenceAnalysis::analyseSubscript(const SCEV *A, return Unknown; } - // TODO: Implement ZIV/SIV/MIV testers. + if (isZIVPair(A, B)) + return analyseZIV(A, B, S); + + // TODO: Implement SIV/MIV testers. DEBUG(errs() << " -> [?] cannot analyse subscript\n"); return Unknown; |
