<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97943>97943</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Hexagon]Enhance the handling of addrspacecast conversions.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DigOrDog
</td>
</tr>
</table>
<pre>
# Description
The below IR code compiles successfully on various architectures including AArch64, x86_64, ARM, Berkeley Packet Filter (BPF), NVIDIA Parallel Thread Execution (NVPTX64), PowerPC, and RISC-V64. However, it encounters compilation issues specifically on the Hexagon architecture. There is a consideration of whether it is essential to strengthen the handling of such cases to ensure compatibility and robustness across all targeted architectures.
https://godbolt.org/z/ja8W85Pjv
# IR
llc in.ll -mtriple=hexagon -mcpu=generic -mattr=+nvs
```
define double @f(ptr %G, ptr %x) {
BB:
%Castaddrspacecast = addrspacecast ptr %x to ptr addrspace(1)
store ptr addrspace(1) %Castaddrspacecast, ptr %G, align 8
ret double 0.000000e+00
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVEFzszYQ_TXismMGBDZw4GCHj34-9KsnzaS9dYS0gBJZYiRhJ_31HQFpmzYMM3qg1dO-fSsx5-SgEWuyP5F9E7HZj8bWjRx-sY0Zos6I95rQDBp03MrJS6NJ0pDk-DQidKjMHc6PwI1A4OY6SYUO3Mw5OtfPSr2D0XBjVprZAbN8lB65ny06kJqrWUg9wPFo-XjICX2At_Lwx4qOjz-H4YT2FRW-w4XxV_TQSuXRAqHl6dISWoWYH8_n5nyEC7NMKVTwNFpkAr69IZ9DwiH6x_Pl6ffAvKy4mDvay0OATAt4PP_6sHs-5DF8N3e8oQ0T0gNqbmbt0bpNHFvopHNzkDkhl73kbJPpR4Tv-MYGoz9JjeFpRIsgHTDgRjsp0K5Mpof7iH5EG7aTDtA51F4yBd6A8xb14EdcuUemhQr1Mn0o8QicOXQhELWb7WoA87KTSvr3RZg13ey8RueAcWvCoBR4Zgf0KD4bEq--jt5PjmRHQltC28GIzigfGzsQ2v5JaPvCyt_K_eXltoaH3jg_rlgpDlLHSsHu6q2cFJKsGbeK7K58mknWDKjRSg67K_Pekqwh9KRvbmM7JNu7fArspUYQZu4UAsmTntBy8sH-_U_Bow2_EVoBKU7rqtMppL9ACLMPzHkmhHUT48iZ80CyBj7_-SAK1Qz471lCyzQ0zUbnvLH4ZcSXO_0rxyVfpuSgofxgs-g_xCVxsjxI6CnZ5JOi-bIskagzUWUVi7BOC5pkeVqlRTTWZSqybN-zviySjmU5UlGxg2D9IacC92kka5rQPCmSIinzfVrEaV4ciioVZV-JPuUFyRO8MqlipW7X4Hq0NHtdFVWeRYp1qNxyV1Cq8b6eBEJpuDpsHdbsunlwJE-UdN79w-KlV8slsx0Qsm--6ZFpjv9r7c_GcKNvaJ002sXRbFX9n_6Ufpy7mJsroW3YbRt2kzUvyD2h7XpaCW1XDbea_hUAAP__oTaYqw">