[llvm] AMDGPU: Ensure both wavesize features are not set (PR #159234)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 02:13:17 PDT 2025


jayfoad wrote:

> In theory we could have some kind of directive to switch the wavesize

Maybe a job for [mapping symbols](https://maskray.me/blog/2024-07-21-mapping-symbols-rethinking-for-efficiency)?

> > In amdgpu-dis we used to hint an llvm-mc command line with -mattr=+wavefrontsize32,+wavefrontsize64 as part of it to accept both variants of instructions
> 
> There's no reason to specify both modes for disassembly. One will definitely win (and it appears wave32 wins).
> 
> > we do rely on being able to disassemble and reassemble these modules.
> 
> If it's disassemble and reassemble, and not assemble there shouldn't be an issue. Disassembly implicitly ignores wave64 for the wave32 targets

You're right, it was not necessary for pure disassembly + reassembly. It only became an issue for disassembly + hand-editing + reassembly. People would naturally write code like this:
```
// ... in a wave64 shader:
v_cmp_gt_u32 vcc, v0, v1
// ... in a wave32 shader:
v_cmp_gt_u32 vcc_lo, v0, v1
```
which you can only reassemble with `-mattr=+wavefrontsize32,+wavefrontsize64`.

https://github.com/llvm/llvm-project/pull/159234


More information about the llvm-commits mailing list