rust-lang / rust-lang/rust

Tracking Issue for amdgcn target

Open
#135,024 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-tracking-issue O-amdgcn T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This issue tracks the implementation of the amdgpu target.

Old, closed tracking issue: #51575

Current work-in-progress branch: https://github.com/Flakebi/rust/tree/amdgpu

Examples and support libraries: https://github.com/Flakebi/amdgpu-rs

Implementation
  • Add amdgpu target: #134740
  • Disable f128 in compiler-builtins: https://github.com/rust-lang/compiler-builtins/pull/737
  • Cast allocas to default address space: #135025
  • Cast global vars to default address space: #135026
  • Add triple to cc crate (once target is in nightly) (not necessary anymore)
  • Add test compiling core and alloc
  • Add gpu-kernel calling convention: #135047
  • Require no_mangle or export_name for gpu-kernel functions: #149991
  • Export <kernel>.kd kernel descriptor symbol: #135909
  • Require explicit -C target-cpu=: #135030
  • Fix linker-plugin-lto only doing thin lto: #136840
  • Fix requiring lto automatically: #149624
  • Remove range-metadata amdgpu workaround: #135027
  • Add tests for the gpu-kernel calling convention lowering to amdgpu_kernel and the global variable addrspacecasts: #146148
  • Support shared memory (dynamic): #135516 #146181
  • Support shared memory (static): #135516
  • Inline assembly: #149793
  • Allow vector types: #149994
  • Get kernel dispatch packet pointer: #150607
  • Tracking Issue for amdgpu arch intrinsics: #149988
Bugs
  • Debug compilation fails due to a bug in LLVM’s AMDGPUResourceUsageAnalysis. This is fixed in llvm main, so will be fixed with the update to LLVM 20
  • rustc may incorrectly copy convergent operations: #137086 #149637 #153995
  • Taking structs as arguments to gpu-kernel functions does not work correctly and should be forbidden: #149991
  • Need -Clink-arg=--no-gc-sections when using linker-plugin-lto: https://github.com/llvm/llvm-project/issues/119479
  • MergeFunctions LLVM pass can generate invalid calls to kernels. Fixed in llvm main, so will be fixed with the next LLVM update: #57356 https://github.com/llvm/llvm-project/pull/174254

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the unchecked implementation items, especially static shared memory support and the amdgpu arch intrinsics tracking issue, then follow the referenced issues and current work-in-progress branch. Done means the remaining checklist items are implemented and the corresponding compiler tests and amdgpu target behavior pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.