[llvm] 7a0d631 - [Attributor] Treat a use by an externally visible global as an escape (#228283)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 00:25:58 PDT 2026


Author: Mian Miftah
Date: 2026-10-02T09:25:35+02:00
New Revision: 7a0d631ecdae36abbf7af8de02fa631c03c2100e

URL: https://github.com/llvm/llvm-project/commit/7a0d631ecdae36abbf7af8de02fa631c03c2100e
DIFF: https://github.com/llvm/llvm-project/commit/7a0d631ecdae36abbf7af8de02fa631c03c2100e.diff

LOG: [Attributor] Treat a use by an externally visible global as an escape (#228283)

AAGlobalValueInfo collects the in-module uses of a local function, and
AAIndirectCallInfo uses them to drop !callees targets whose address
cannot reach the call. It follows uses through global initializers
without checking whether the global is visible outside the module, so it
misses an address that escapes that way.

For an internal function whose address is stored in an external global
and that is called through a pointer argument, the Attributor drops the
only !callees target and replaces the call with unreachable. This
happens in the module pass, in the CGSCC pass when the function and the
caller are in one SCC, and in OpenMPOpt, which runs the Attributor on
OpenMP device code at -O1 and above.

Treat a use by a global without local linkage as an escape unless the
module is a closed world.

Added: 
    llvm/test/Transforms/Attributor/callees-metadata-escape.ll

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################<html><body><h1>504 Gateway Time-out</h1>
The server didn't respond in time.
</body></html>


        


More information about the llvm-commits mailing list