Skip to content

offload: remove device.bin and pass device bitcode directly - #164455

Open
sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:offload-cleanup-1
Open

sgasho wants to merge 1 commit into
rust-lang:mainfrom
sgasho:offload-cleanup-1

Conversation

@sgasho

@sgasho sgasho commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

related: #164057

Since #162309 removed the clang-linker-wrapper step, nothing reads device.bin
anymore, and its triple/arch are already in the bitcode.

So, as the first step, I removed steps generating and extracting device.bin, instead we're going to use the device bitcode.

As a next step, the host pass could take the linked device output(.ptx for NVPTX, .elf for AMDGPU) instead, which
would remove the second codegen. I'd like to do that in a separate PR.

I'll update rustc-dev-guide in a follow-up PR in their repo.

I verified that this change works by running offload sample code on UofT gpunode.

r? ZuseZ4

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants