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

Richard Osborne richard at xmos.com
Wed Mar 28 09:52:53 PDT 2012


My understanding is that with gcc inline asm the "memory" clobber should 
be specified whenever an asm statement may access memory that isn't 
accessible via one of its operands.

For example with the following code:

int x;
int foo()
{
   int y;
   x = 1;
   asm("");
   x = 2;
}

gcc 4.4.3 optimizes away the first store to x. This optimization is 
disabled if "memory" is listed as one of the clobbers. This patch 
teaches basic alias analysis that calls to inline asm without the 
"memory" clobber only access their argument pointers.

-- 
Richard Osborne | XMOS
http://www.xmos.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: aa_inline_asm.diff
Type: text/x-patch
Size: 1822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120328/b8ccbe82/attachment.bin>


More information about the llvm-commits mailing list