[llvm-commits] [Patch] Teach basic alias analysis about inline asm "memory" clobber

Richard Osborne richard at xmos.com
Thu Mar 29 07:14:24 PDT 2012

On 28/03/12 20:53, Richard Osborne wrote:
> However after a bit more thought I'm worried about another problem. If 
> we return OnlyAccessesArgumentPointees then there will be no 
> dependence between two inline asm calls with the "sideeffect" keyword 
> without the "memory" clobber if we can prove that none of the 
> arguments of the first inline asm call can alias any of the arguments 
> of the second inline asm call. This would allow us to motion one of 
> the asm calls around the other. However based on the description of 
> volatile asm I'm not sure if this would be valid. This makes me think 
> I should look at modifying the getModRefInfo(ImmutableCallSite CS, 
> const Location &Loc) method instead.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
The updated patch fixes this problem. It introduces the concept of 
"InvisibleMemory" - memory which can never be accessed via a load or 
store via pointer. This allows us to reason about instructions / calls 
with side effects that would prevent (for example) reordering the calls 
around each other but shouldn't inhibit optimizations of loads / stores.

Does this seem like a reasonable approach?

Richard Osborne | XMOS

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120329/62a844f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aa_inline_asm.diff
Type: text/x-patch
Size: 8625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120329/62a844f9/attachment.bin>

More information about the llvm-commits mailing list