<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/129635>129635</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
AMDGPU should handle local stack slot allocation optimization for scalar uses of frame indexes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AMDGPU,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
WIP patch: [0001-AMDGPU-LocalStackSlotAlloc-support-for-s_add_i32.patch](https://github.com/user-attachments/files/19063529/0001-AMDGPU-LocalStackSlotAlloc-support-for-s_add_i32.patch)
The local stack slot optimization currently does not work for SALU uses of frame indexes. The difficulty is the pass assumes there is one register class to use for the base register, but we need to contextually select a VGPR or SGPR depending on the uses
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykUtFq4zoQ_Rr5ZXCQ5TiJH_yQNqRc6IVye7v7WGRpHGsrS0Yzbpv9-kXJQneh7MuCYEAzc-ZwztFE7hQQO9HciOZQ6IXHmDqdCMNU9NGeu6__PMCs2Yyi3oNobqSUVbn_93D38FTeR6P9I2vz8ugj772PpqRlnmPicoippGdt7bOr1eqK0ByE2o3MM4l6L9RRqOPJ8bj0KxMnoY4LYSo1szbjhIFJqOPgPOZatXJTN6oV6vg3DFQr5P76_h8RfF4HyvtAPjLEmd3kvmt2MYBZUsLA_gw2IkGIDG8xvcAQEzzu759gISSIAwxJTwguWHxHWkFGtm4YnFk8n8ER8IgwayLQRMuEl4-EuRMDQsKTI8YExucZjhn4ciXv9Zo-RoS6hX5heEMIiDbPmhgY33nR3p-B0KNh0PDl7uE_yDxztThjsC6cIIYL5oV4YbvatnWrC-yq7bqSza5ab4ux22rZrxvZ43YrW2t2ttngBtuhrrBpW2ML1ympGlnLtayrZr1dqdru5KAG3Mld3Uop1hIn7fzK-9dpFdOpcEQLdpVqN3VTeN2jp0volOq1ecFgRb2_eiqUEupWKDU5IrTlr5bkXnMoUpdxy345kVhL74jp4xI79thdsYDGuHgLow7Wf2K3zoG5mv2b81l7Mtrr9LnHxZJ894cgZzI_Szmn-A0NC3W8aHAJ81WG1079CAAA___vVy0Y">