[LLVMdev] Pointer "data direction"
dmitry at kernelgen.org
Wed Jan 9 06:48:52 PST 2013
This kind of analysis is a pretty complex problem in general case.
Consider, for instance, function "f" has nested calls of other functions
with "side effects", meaning they could potentially change the contents of
"in" or "out" indirectly. For this reason, even current state-of-art
commercial APIs that imply strong data analysis (like OpenACC or HMPP)
require functions to be free of side effects, because nobody could solve
this problem well at compile-time.
Depending on the purpose of your question, this may or may not help: in
comparison to general analysis, LLVM community makes way better progress in
analysing data access patterns for vectorization and parallelization. In
this case, particular code regions or loops are considered for matching
suitable access patterns. For details on vectorization - you can look into
the work by Nadav Rotem, Hal Finkel et al, the work by Preston Briggs ,
for details on polyhedral analysis - the Polly project . These two could
be extended further with runtime-assisted data analysis, where knowing
actual values of pointers and index ranges you can also make conclusions
about read/write modes with respect to particular code regions, like in .
Hope it helps,
2013/1/9 Sebastian Dreßler <dressler at zib.de>
> suppose the following C function declaration:
> void f(int *in, int *out);
> Now further suppose, that _in_ is an array only read from and _out_ is
> an array that is only written to.
> Based on this, I was wondering whether there is some already existing
> LLVM pass (or maybe a part of a pass) that detects those "data
> directions" for pointers. I'm not quite sure whether e.g. Alias Analysis
> can provide me this information (I suppose it *cannot*).
> Best regards,
> Mit freundlichen Grüßen / Kind regards
> Sebastian Dreßler
> Zuse Institute Berlin (ZIB)
> Takustraße 7
> D-14195 Berlin-Dahlem
> dressler at zib.de
> Phone: +49 30 84185-261
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev