[PATCH] [globalsmodref-aa] Atomics *DO* touch memory...

Sean Silva chisophugis at gmail.com
Fri Apr 24 20:56:58 PDT 2015


GlobalsModRef was giving a spurious alias analysis result because it failed
to consider that atomics access memory. The attached patch fixes that
(PR23345).

I reduced this from a "compare and swap" loop that looked funny in the
machine code: the "compare and swap" had in fact been hoisted out of the
loop. I only ran into this when I tried `-flto -O2 -fno-inline`.

The structure of the test is pretty closely copied from one of the others
in the directory. Any better ideas for testing this (or ways to make the
testing more thorough) would be appreciated.

If somebody can doublecheck that these are the only missing cases, that
would be appreciated. This loop been touched since 2012 and I'm relatively
clueless about AA. Hopefully this patch also suggests a couple other places
to audit for similar bugs to those with a better "big picture" of the IR
analysis and transforms than myself.

-- Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150424/41ba02fb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: globalsmodref.patch
Type: application/octet-stream
Size: 1803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150424/41ba02fb/attachment.obj>


More information about the llvm-commits mailing list