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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 27 11:58:20 PDT 2021


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 default address space for sret pointers. This
causes inefficient code generated for AMDGPU backend since
alloca address space is 32 bit whereas generic pointer is 64 bit.
It also causes assertions where alloca address space is expected.

This patch uses alloca address space for sret pointers. It is NFC
for targets alloca address space of which is default address space.


https://reviews.llvm.org/D101389

Files:
  clang/lib/CodeGen/CGCall.cpp
  clang/test/CodeGenCUDA/amdgpu-sret.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101389.340934.patch
Type: text/x-patch
Size: 4042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210427/2e116a1f/attachment.bin>


More information about the cfe-commits mailing list