[PATCH] D138336: [AA] A global cannot escape through nocapture/nocallback call.
Slava Zakharin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 15:56:39 PST 2022
vzakhari created this revision.
vzakhari added reviewers: jdoerfert, gulfem, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: All.
vzakhari requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
When an internal global is passed to a 'nocallback' call as
a 'nocapture' pointer, it cannot escape through this call and
be indirectly referenced in this module.
So it must not alias with any pointer in the module.
This may provide some remedy for Fortran module-private array descriptors
that are usually passed by address to some runtime functions
(e.g. to allocation/deallocation functions). In general, a good aliasing
information derived from Fortran language rules would solve the same issue,
but I think this change may be beneficial as-is (given that nocapture,
nocallback attributes are properly set).
https://reviews.llvm.org/D138336
Files:
llvm/lib/Analysis/GlobalsModRef.cpp
llvm/test/Analysis/GlobalsModRef/noescape-nocapture-nocallback.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138336.476623.patch
Type: text/x-patch
Size: 6547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/20240839/attachment.bin>
More information about the llvm-commits
mailing list