[PATCH] D109594: [AMDGPU] Initialize LDS pointers after alloca, but before call.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 13 03:49:09 PDT 2021
foad added a comment.
In D109594#2997091 <https://reviews.llvm.org/D109594#2997091>, @JonChesterfield wrote:
> I don't understand the precondition. Why after every alloca but before every call?
>
> It seems like you want to introduce N stores to addrspace(3) globals, where each store needs to precede any loads from that global. I can see 'call' as a rough approximation for 'might load', but why is alloca involved at all?
It's a QOI thing. You want to try hard to leave allocas in the entry block if possible, because LLVM convention is that allocas in the entry block are static (allocated very efficiently on entry to the function) and allocas elsewhere are dynamic (allocated less efficiently, has knock-on effects like forcing you to reserve a frame pointer register, possibly not even supported by the AMDGPU backend?). See also D108971 <https://reviews.llvm.org/D108971> for some prior discussion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109594/new/
https://reviews.llvm.org/D109594
More information about the llvm-commits
mailing list