[llvm-commits] [PATCH] SIV tests in LoopDependenceAnalysis
Hal Finkel
hfinkel at anl.gov
Fri Mar 2 15:30:20 PST 2012
On Tue, 14 Feb 2012 03:44:47 +0530
Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> Hi,
>
> These two patches add support for analyzing strong SIV, weak-crossing
> and weak-zero SIV subscripts to the LoopDependenceAnalysis pass.
>
> Thanks!
I have a few comments...
> //
> //===----------------------------------------------------------------------===//
>
> +#include <iostream>
> #define DEBUG_TYPE "lda"
Don't include <iostream>.
> + Loop *theLoop; // There is only one loop we're concerned about.
> + {
> + DenseSet<Loop*> loops;
> + getLoops(A, &loops);
> + getLoops(B, &loops);
> + assert(loops.size() == 1 && "Expected single loop in SIV test!");
> + theLoop = *loops.begin();
> + }
What happens for nested loops?
> /// a given SCEV is variant.
> - void getLoops(const SCEV*, DenseSet<const Loop*>*) const;
> + void getLoops(const SCEV*, DenseSet<Loop*>*) const;
Why did this change?
Also, it might be a good idea to break up analyseSIV in to multiple
functions, one for each case being tested.
As a general question, will the approach here scale to handling
multi-dimensional indexing? I've not thought about this in detail, but
it looks like this extends the analysis to handle i*n+j; what will we
need to do in order to handle (j+i*n)*m + k (although maybe I just
don't understand how nested loops are handled here)?
Do you have any ideas about how to test this? Maybe that can wait until
something actually uses the analysis.
Thanks for working on this!
-Hal
--
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-commits
mailing list