shiltian wrote: Hmm, the AMDGPU backend has a pass to change the function signature, appending implicit kernel arguments. This will make the `KernelLaunchEnvironment` not always the last one. https://github.com/llvm/llvm-project/pull/185989