[LLVMdev] Pointer "data direction"

Dmitry Mikushin dmitry at kernelgen.org
Wed Jan 9 06:48:52 PST 2013

Hi Sebastian,

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 [1],
for details on polyhedral analysis - the Polly project [2]. 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 [3].

[1] https://sites.google.com/site/parallelizationforllvm/
[2] http://polly.llvm.org/
[3] http://kernelgen.org

Hope it helps,
- D.

2013/1/9 Sebastian Dreßler <dressler at zib.de>

> Hi,
> 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,
> Sebastian
> --
> Mit freundlichen Grüßen / Kind regards
> Sebastian Dreßler
> Zuse Institute Berlin (ZIB)
> Takustraße 7
> D-14195 Berlin-Dahlem
> Germany
> dressler at zib.de
> Phone: +49 30 84185-261
> http://www.zib.de/
> _______________________________________________
> 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/20130109/35fc4718/attachment.html>

More information about the llvm-dev mailing list