<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63515>63515</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[RISCV] Store multiple value to same memory address when calling llvm.bitreverse.nxv2i64 intrinsic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Yunzezhu94
</td>
</tr>
</table>
<pre>
When running following case with attribute -march=rv32imacv :
```
declare <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64>)
define i32 @main() {
%1 = insertelement <vscale x 2 x i64> zeroinitializer, i64 3, i64 3
%2 = tail call <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64> %1)
%3 = extractelement <vscale x 2 x i64> %2, i32 3
%4 = trunc i64 %3 to i32
ret i32 %4
}
```
It generates codes:
```
sw a0, 12(sp)
lui a0, 1044480
sw a0, 8(sp)
lui a0, 61681
addi a0, a0, -241
sw a0, 12(sp)
sw a0, 8(sp)
lui a0, 209715
addi a0, a0, 819
sw a0, 12(sp)
sw a0, 8(sp)
lui a0, 349525
addi a0, a0, 1365
sw a0, 12(sp)
sw a0, 8(sp)
```
and following vlse instructions can not get correct value.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE1v4jwQ_jXOZQTyRz4PObTlRer1rbSrPTrOlHjl2Mh2AuXXrxwQdCXaXakrIQh5PM-H7RkZgt5ZxJYUj6TYZHKKg_Ptj8me8DRMTZ51rn9rvw9owU_WaruDV2eMO6QnJQPCQccBZIxed1NEWI3Sq4GIjZ8F16NUMxDxQOiG0AdS0stn-dujMtIjEPE0ByUNwhE4HEGXORH_AcmpMfO47nT0OKMPuLbHmSeU1_drCG8uSheBV20RtOCJbJTapkreAKkezyuA8IIBERvQNqCPaHBEGz-ydELvtNVRS6NP6Al_SgiI28OVlS-sUWoDShrzD0Munq9JASC9EIscHqOX6k8pkrvFseBXx2eW_GzaT1YteRbi6NLK2zqP8bylvMgvu11t7h7wc4QdWvQyYgDlegwfXQUIB0IbSZMtxgmvw_7dWTZm0jeY5nle0yv2rrL-tLBkZc2uiOz7G3T-XvGc3aO9Y-ivRTltKlZ8plqzu7RfERV5U_BPRZkoi6-r_n6G0vbvZsNsAqamin5SUTsbQEkL1qUrEUE571FFmKWZcJ31regb0cgMW1bWVVUWJWPZ0HZIy76rZKdojViIDlnFUElR1VVNFWa65ZQLWvKSVnlZsHXdvApa17wpmKioaEhOcZTarJcuc36X6RAmbEtRsCIzskMTluHHucUDLCDhPM1C36aaVTftQupSHWK4sUQdzTI1_39-efpGig28ROcRxslEvTd4TpZ6J8gRYcTR-TeQfe8xBDikeZrGQtqpD_oftI1e26BVNnnTDjHul_bhW8K3Ox2HqVsrNxK-TQSXn9Xeu5-oIuHbJUogfLtE_RUAAP__DJGoHg">