[PATCH] D91928: [nvptx] Skip alloca for read-only byval arguments.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 22 15:02:35 PST 2020


hliao abandoned this revision.
hliao added a comment.

In D91928#2410283 <https://reviews.llvm.org/D91928#2410283>, @jlebar wrote:

>> In case it's not used in PHI or SELECT and cannot ensure the result is also a pointer to the parameter space, we could skip alloca insertion.
>
> I think an allowlist might be more appropriate than a denylist.  Rather than, anything other than PHI and SELECT, could it be, if it's only transitively used by gep and load we're good?
>
> I am not 100% sure even that works, though.  The real problem is that this pass is trying to reason about what the addrspace inference pass is capable of.  We can only do the transformation if here if we're positive that addrspace inference will eliminate all generic loads from the arg.  That's a layering violation and ultimately is fragile.

yeah, it seems the other approach is more appropriate to place the `alloca` in the frontend and that explicitly copy from the parameter space to the private space.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91928



More information about the llvm-commits mailing list