Skip to content

[AMD] Add AMD LLVM kernel attributes option#10367

Merged
antiagainst merged 1 commit into
triton-lang:mainfrom
raikonenfnu:raikonen/add_fn_attribute_upstreamable
May 27, 2026
Merged

[AMD] Add AMD LLVM kernel attributes option#10367
antiagainst merged 1 commit into
triton-lang:mainfrom
raikonenfnu:raikonen/add_fn_attribute_upstreamable

Conversation

@raikonenfnu
Copy link
Copy Markdown
Contributor

@raikonenfnu raikonenfnu commented May 25, 2026

Motivation for this PR is to enable kernel authors to feed/select different llvm fn attributes locally at a kernel level scope as optimizations/llvm fn attributes could differ between kernels. This PR has 3 main changes:

  1. Extend the LLVM function binding so add_fn_attr can emit valueless attributes. LLVM distinguishes bare function attributes from string-valued attributes, and AMD kernel attrs may need either form.
  2. Add the HIP llvm_fn_attrs option so kernel authors can attach comma-separated LLVM function attributes to their own kernel during compilation without changing global backend state.
  3. Add AMD tests covering single attributes, multiple attributes including a bare attr, and a sched-strategy attr that changes generated AMDGCN.

Extend the LLVM function binding so add_fn_attr can emit valueless attributes. LLVM distinguishes bare function attributes from string-valued attributes, and AMD kernel attrs may need either form.

Add the HIP llvm_fn_attrs option so kernel authors can attach comma-separated LLVM function attributes to their own kernel during compilation without changing global backend state.

Add AMD tests covering single attributes, multiple attributes including a bare attr, and a sched-strategy attr that changes generated AMDGCN.

Signed-off-by: Stanley Winata <stanley.winata@amd.com>
@raikonenfnu raikonenfnu force-pushed the raikonen/add_fn_attribute_upstreamable branch from 0fd3511 to b9b1242 Compare May 27, 2026 22:51
@antiagainst antiagainst enabled auto-merge (squash) May 27, 2026 23:19
@antiagainst antiagainst merged commit 71ba10e into triton-lang:main May 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants