[llvm] [llvm] Preserve existing calling conv when auto-upgrading nvvm.annota… (PR #125568)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 13:33:42 PST 2025


shiltian wrote:

> > > Kernels produced by ROCm classic flang may have both nvvm "kernel" annotation and amdgpu_kernel calling convention.
> > 
> > 
> > I think this should be fixed in classic flang instead of here. This is treating symptoms instead of root cause.
> 
> I considered that, but thought that this fix would be better since there may be existing bitcode files with the condition.

I'm not sure bitcode is meant for backward compatibility. I think users should always use bitcode come with its compiler.

> Also, it wasn't clear to me that this was invalid. That is, I wasn't sure if the presence of the nvvm "kernel" annotation always implied a PTX kernel. Documentation [here](https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#global-property-annotation-chapter-11) seems to imply that the annotations may be used in other cases.

Well, my reading is, NVVM already implies the target and having NVVM annotations along with AMDGPU stuff is something that I don't know what to say.

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


More information about the llvm-commits mailing list