Artem-B wrote:

I don't think `byval` for scalars is the right thing to do here.

Scalars are already passed by value, and `nvvm.grid_constant` already marks the 
ones we care about. This patch turns them into pseudo-aggregates so they happen 
to reach the copy-avoiding paths in NVPTX lowering. It happens to work, but it 
works around the gap in the current implementation instead of fixing it, IMO.

I'd prefer to keep these arguments direct and teach the NVPTX back-end to 
handle `nvvm.grid_constant` on scalars: use `cvta.param` when the target 
supports it, and fall back to a copy otherwise. That would probably address the 
underlying issue. 

https://github.com/llvm/llvm-project/pull/231567
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to