[PATCH] D69679: [AMDGPU] Add amdgpu-promote-pointer-kernargs pass

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 15:11:52 PDT 2019


tra added a comment.

@arsenm has a point.  We can do it in clang, and it seems to be a better long-term solution compared to patching-up the inputs' AS that we've done for NVPTX and, now, AMDGPU.

On the other hand I wonder whether the benefit is worth the effort. It moves responsibility of coercing pointers' AS from LLVM to the end-users with not much to show for it. I think the only real issue I see with the status quo and this patch is that this is the second instance of a trivial pass that does this kind of job. Perhaps we can make it into a generic IR pass which would be able to coerce the pointers to the right address space and use it for both AMDGPU and NVPTX.

If we do want to change the IR-level calling convention for the kernels, clang would not be the only place that would need to adapt to that change. We will need to think about transitioning existing external users, too (e.g. XLA in TensorFlow & JAX, julia). We may need to keep the promote-pointers-to-global-AS pass around for a while until the LLVM users have a chance to change their code to pass pointers using correct address space.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69679/new/

https://reviews.llvm.org/D69679





More information about the llvm-commits mailing list