wenhu1024 wrote: I agree, and I'd also prefer to handle this entirely in the NVPTX backend.
However, I haven't found a reliable way to distinguish these two cases in the generated IR: taking the address of a `__grid_constant__` scalar parameter directly, and taking the address of an explicit local copy. Both appear to be lowered to an `alloca` initialized from the parameter. Here's a reproducer showing the two cases: https://godbolt.org/z/a7eT3vMK6 Do you have any suggestions on how to distinguish them? https://github.com/llvm/llvm-project/pull/231567 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
