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

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 22 14:38:11 PST 2020


jlebar added a comment.

> 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.


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