[llvm] [AMDGPU][GlobalISel] Handle constant i32 ballot on wave64 (PR #205536)

Keshav Vinayak Jha via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 05:07:46 PDT 2026


keshavvinayak01 wrote:

> > In that case @mgcarrasco it looks like this is an expected crash, maybe the verifier should handle this?
> 
> This is the kind of case that calls for using #201470's error with a subtarget feature check that's dependent on the type signature

That sounds reasonable, but based on the current implementation in that PR, `ballot.i32` and `ballot.i64` are two overloaded spellings of the same TableGen intrinsic:
```cpp
def int_amdgcn_ballot :
  Intrinsic<[llvm_anyint_ty], [llvm_i1_ty], ...>;
```
and so both map to `Intrinsic::amdgcn_ballot`, so something like `let TargetFeatures = "wavefrontsize32` on top of that tablegen won't really work for our usecase.

So I'll need to update the #201470 intrinsic feature check to pass the overloaded intrinsic signature/result type, it's probably worth doing because its bound to happen again for other intrinsics.

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


More information about the llvm-commits mailing list