[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl abandoned this revision. yaxunl added a comment. In D101389#2724757 , @rjmccall wrote: > In D101389#2724700 , @yaxunl wrote: > >> In D101389#2724636 , @rjmccall >>

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D101389#2724700 , @yaxunl wrote: > In D101389#2724636 , @rjmccall > wrote: > >> I think this is intentional; requiring the indirect-result parameter to be >> in the alloca address sp

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101389#2724636 , @rjmccall wrote: > I think this is intentional; requiring the indirect-result parameter to be in > the alloca address space would prevent direct initialization of non-temporary > memory, which is an important

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. I think this is intentional; requiring the indirect-result parameter to be in the alloca address space would prevent direct initialization of non-temporary memory, which is an important optimization in C++. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101389/

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 341257. yaxunl added a comment. cast return value to default address space since it is expected. also fix debug info CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101389/new/ https://reviews.llvm.org/D101389 Files: clang/lib/CodeGen/CGCall.cpp

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 341054. yaxunl added a comment. fix invalid bitcast due to sret pointer passed to ctor CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101389/new/ https://reviews.llvm.org/D101389 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CodeGenCUDA/amdgpu-s

[PATCH] D101389: [clang][CodeGen] Fix address space for sret

2021-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. Herald added subscribers: kerbowa, tpr, nhaehnle, jvesely. yaxunl requested review of this revision. sret is returned through temporary variables allocated on stack, therefore it should use alloca address space. Currently clang use