You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PTX pipeline runs LLVM's default O2 pipeline, but non-kernel Rust device helpers retain external linkage. Even after every call has been inlined, GlobalDCE cannot remove an externally visible definition, so llc can emit unreachable .visible .func bodies into final PTX.
This increases PTX size and leaves compiler-generated helper symbols in an artifact whose externally consumed API consists of kernel entries, standalone device-function exports, and host-visible globals.
The optimizer must not infer public roots from rendered LLVM text or assume that kernels are the entire module ABI. CUDA Oxide also emits standalone device functions and defined globals such as #[constant] symbols that host code resolves by name.
Until the IR distinguishes host-visible globals from compiler-private storage, retaining all defined globals is the conservative behavior that preserves existing linkage.
Reproducer
A module containing a marked kernel and an otherwise unused device helper emits both definitions without optimization. The optimized result should retain the kernel entry and remove the helper. As an adjacent ABI check, the constant_memory example must continue to locate, populate, and read its constant symbol from the host.
Acceptance criteria
Non-root helper definitions are absent from optimized PTX.
Kernel entries, standalone device-function roots, and defined globals retain external linkage.
The optimizer receives roots from typed exporter state, without parsing rendered LLVM.
Modules without roots and no-opt compilation retain their current behavior.
Activity