[PATCH] D35974: AMDGPU: Add pass to replace out arguments
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 22:30:24 PDT 2017
arsenm added inline comments.
================
Comment at: lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp:120
+
+ // TODO: It might be useful for any out arguments, not just privates.
+ if (!ArgTy || (ArgTy->getAddressSpace() != DL->getAllocaAddrSpace() &&
----------------
rampitec wrote:
> I'm not sure you actually can do it on a non-private. Other address spaces are externally visible and stores to them shall not be easily eliminated. The exception is a non-aliasing LDS variable with function local scope.
The memory access isn't actually eliminated here, it's just moved to the stub function. and relies on other passes to fix it so it is OK. The hope with private is it the temporary alloca will be SROAable
================
Comment at: lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp:300
+ RetAttrs.addAttribute(Attribute::NoAlias);
+ NewFunc->removeAttributes(AttributeList::ReturnIndex, RetAttrs);
+ // TODO: How to preserve metadata?
----------------
rampitec wrote:
> Consider also marking it always inline.
The stub function is marked as always inline. The new function here steals the body of the old function, the original function is then marked always inline
https://reviews.llvm.org/D35974
More information about the llvm-commits
mailing list