[llvm-commits] [llvm] r78157 - in /llvm/trunk: include/llvm/Analysis/LoopDependenceAnalysis.h lib/Analysis/LoopDependenceAnalysis.cpp test/Analysis/LoopDependenceAnalysis/alias.ll test/Analysis/LoopDependenceAnalysis/ziv.ll
Andreas Bolka
andreas.bolka at gmx.net
Wed Aug 5 20:11:25 PDT 2009
On Wed Aug 05 07:29:49 +0200 2009, Nick Lewycky wrote:
> Andreas Bolka wrote:
> > Author: abolka
> > Date: Tue Aug 4 23:26:05 2009
> > New Revision: 78157
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=78157&view=rev
> > Log:
> > ZIV tester for LDA.
> >
> > Modified: llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp?rev=78157&r1=78156&r2=78157&view=diff
> >
> > ==============================================================================
> > --- llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp (original)
> > +++ llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp Tue Aug 4 23:26:05 2009
> > @@ -136,6 +136,19 @@
> > 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;
>
> Doesn't that imply A == B ? Dependent : Independent? In what other
> case could this happen?
Yes, I think with SCEV's canonicalization, A == B is sufficient. Thanks,
committed as r78277.
--
Andreas
More information about the llvm-commits
mailing list