[PATCH] D11410: [GMR] Teach GlobalsModRef to distinguish an important and safe case of no-alias with non-addr-taken globals: they cannot alias a captured pointer.

hfinkel at anl.gov hfinkel at anl.gov
Sat Jul 25 15:08:20 PDT 2015

hfinkel added inline comments.

Comment at: lib/Analysis/IPA/GlobalsModRef.cpp:713
@@ +712,3 @@
+        // Arguments to functions or returns from functions are inherently
+        // capturing, so we can immediately classify those as not aliasing any
+        // non-addr-taken globals.
Also, while I don't think the code here is wrong, the word 'capturing' in the comment could be a bit misleading. The argument in question, for example, could have the 'nocapture' attribute. This is okay, however, because we consider any global's address being passed to a function as having its address taken (even via a nocapture argument).

I think it would be nice for the comment to explain this.


More information about the llvm-commits mailing list