[llvm-dev] Informing transformation passes of non-concurrent memory accesses

Andreas Scherman via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 14 03:56:37 PDT 2017


Hi!

The example in the docs[1] states that the LLVM concurrency model does not
allow the hoisting of loads and introduction of local variables due to
another thread potentially altering the value whilst running the function.
Given that I have analysis which shows that the memory location of variable *x
*can not be concurrently accessed -- how would I inform the LLVM
transformation passes of this information?

I tried injecting this information in to the AliasAnalysis under
getModRefInfo() by returning NoModref for the memory locations I knew not
to be accessed concurrently. However, it seemed that the usages of the
variables was not respected in that case, such that we could reorder
variables and change the semantics of the program.

Thanks in advance,

Andreas

[1]: http://llvm.org/docs/Atomics.html#optimization-outside-atomic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170314/528d3e11/attachment.html>


More information about the llvm-dev mailing list