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. 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? Thanks in advance, Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110622/87484626/attachment.html>
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>
On 22.06.2011, at 17:03, John Criswell wrote:> 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.Where can I find some information about MemoryDependenceAnalysis and DataStructureAnalysis? It would be interesting which kinds of dependence they're able to find and which not. Andreas> >> 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/20110624/2d546171/attachment.html>