[clang] [AMDGPU] Stop coercing structs with FP and int fields to integer arrays (PR #185083)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 1 23:20:18 PDT 2026


addmisol wrote:

> > @arsenm and @addmisol I seems seeing some behavior change with this PR. The small struct with fp16 type used to be packed, no longer gets packed.
> 
> The behavior change (fp16 structs no longer packed to i32) is intentional - we preserve float types now.
> 
> However, I understand the concern about packing efficiency.. A potential solution would be to pack uniform float structs into vector types instead(if i am correct..):
> 
> {__fp16, __fp16} to <2 x half> (instead of i32 or {half, half}) {float, float} to <2 x float> (instead of [2 x i32] or {float, float})
> 
> This would:
> 
> * Preserve float type information
> * Pack into a single value/register
> * Enable SIMD optimizations
> 
> @cmc-rep it would also be helpful if you can post any godbolt link here as @arsenm said..
> 
> cc @arsenm

something like https://github.com/llvm/llvm-project/pull/195417 for uniform types

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


More information about the cfe-commits mailing list