<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/129184>129184</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm.amdgcn.is.shared and llvm.is.private should be captures(address) to reinstate promote alloca optimization on addrspacecast
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
These were previously marked as nocapture, and have upgraded to using captures(none). This is too aggressive, since it observes the address space of the value.
We need this to be captured(address) so we can restore the optimizations removed in 21cea3f3be51d5c3856b87fed301b5fc3dddade4
We should be able to replace allocas in kernels which are addrspacecasted to generic and then passed to another function. We are replacing the underlying object with another valid address space cast source so it should be valid in most cases. This is hazardous if the use code is querying the address space, which should be considered as an address capture.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxcU8GSozYQ_Rpx6VoKBNhw4OBkyzmlKodN7bmR2qCMkIhaYmr261PCnhlPTi7T3e-9fv2EzGZ2RKPofhPd9wJTXHwYMTC5tZi8fht_LMQErxQItkC78YntG6wYXkgDMjivcIspkJC_AzoNC-4EaZsDatIQPSQ2boZHFwvZO-9IyKGEH4thMAzRe8B5DsRs9gOIjVMEJoKfmMJODHEhQK1zD_CGisDfjo872kQliOoiqstPAkeZdjlgYaJ3Yi1k_5gXcgD28JprDgJx9IEOLL9Fs5pfGI13DIFWv5MG40DWirC5NRN1te5U03enqT_fSDdVPXU31WitUVP7oYIXn6zO_DhZylICbTbLRmu9Qs6oLxQcWYbXxagFMNw3PLZTyPFu30yOglGHt3EhBxsy30vofFwowC05lSWX8JMOmDtXtj1vlZymYN_yXz_9QyrCq4nLx_SO1uj_eZvpgX0KirJVJj4tdO83DlbPMXcSf55ywV8YtE8M5n6exATKa8rFfxOFt3dVXwjzze8ufPIo79hoCvecofuYeFy0LPTY6KEZsKCxPrfVuR4a2RfLWJ1xOvV4wnbAtj7dmlNzartmaOXUd7KfCjPKSnaVlH3VVX3bl_VQtefbrRnOTXdqlRZtRSsaW1q7r6UPc2GYE421HOq-LSxOZPl4NVJOqF7IadFcLn9-_-Ovv4WU-S2FMc9-m9LMoq2s4cifaNFES0dDiauelSsNl7zgsazTcFQMl1swO8bnOD29o6c4H_kyjmNu3oJffXxP2pdQg3dfM1akYMclxo1FcxHyKuR1NnFJU6n8KuQ1C3n8fNuCz-kR8nqYwUJeH37so_wvAAD__7zifNA">