[LLVMdev] Memory dependence analysis

John Criswell criswell at illinois.edu
Wed Jun 22 08:03:16 PDT 2011


On 6/22/11 5:34 AM, Andreas Wilhelm wrote:
> Hello,
>
> I'm looking for a way to identify dependencies of 
> function-pairs (memory-dependency, control-dependency...) in order to 
> parallelize them.
> For aliasing problems I use the DataStructureAnalysis.

I'm assuming that this is the DSA analysis in the poolalloc module.  Be 
forewarned that:

1) DSA works with LLVM 2.7; I don't believe it works with LLVM mainline yet.
2) The alias analysis interface to DSA hasn't been maintained in awhile; 
you'll need to examine the DSGraphs directly.


> To solve simple memory- and control-dependency problems I want to use
> memdep. But unfortunately I even fail with following simple C++ example...
>
> int a( int n) { return n; }
> int b( int n) { return n; }
> int c( int n) { return n; }
>
> int main( int argc, char** argv) {
>
>   int x = a( argc);
>   b( 0);
> if ( x)
>     x = 0;
>
>   return ( c( x));
> }
>
> ... The result of memdep shows a dependency between the callsite of 
> b() and the call of a(). Why?
> Moreover I want to get the dependency between the call to c() and the 
> result of a(). How can I obtain this?
>

I can't comment on what memdep does as I've never used it; others more 
knowledgeable will have to comment.

Regarding your last question on following the def of x to the use in 
c(x), that looks like a simple data-flow analysis problem; just follow 
the def-use chain of the SSA variables from the call of a() to the call 
of c() in main().

-- John T.

> Thanks in advance,
> Andreas
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110622/c6670c90/attachment.html>


More information about the llvm-dev mailing list