jhuber6 wrote:

> The nvptx lowering looks dubious - values smaller than slot size should be 
> passed with the same alignment as the slot and presently aren't. A struct 
> containing i8, i16 or half should be miscompiled on nvptx as written.

I mentioned this in the original patch, it's correct as far as I know. NVPTX 
does not require nested structs to have slot alignment, which means that the 
minimum alignment is exactly the type. The C ABI helps us here by making 
arguments passed directly all get type promoted to `i32`. You could 
theoretically break this if you didn't go through the C ABI and ignored type 
promotion, but I'm not concerned with that kind of misuse since it's against 
the ABI in the first place.

https://github.com/llvm/llvm-project/pull/96369
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to