<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58271>58271</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ARM][Load/Store Opt] adjacent `str`s can be folded to `strd`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:ARM,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
Looking at the following code:
```c
// --target=arm-linux-gnueabi -O2 -mllvm -replexitval=never
long float64_rem_b;
long long float64_rem_aSig;
void float64_rem() {
unsigned bSig = float64_rem_b | 10000000000000;
do
float64_rem_aSig -= bSig;
while (0 <= float64_rem_aSig);
}
```
we generate:
```asm
...
.LBB0_1: @ =>This Inner Loop Header: Depth=1
subs r3, r3, r2
sbc r1, r1, #0
cmn r1, #1
bgt .LBB0_1
str r3, [r0]
str r1, [r0, #4]
bx lr
```
The stores at the end look like they could be transformed into `strd r3, r1, [r0]` I think? Looks like there is a `arm-ldst-opt` pass in LLVM that's probably appropriate for this.
cc @DavidSpickett @david-greene-cb
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFVN9v4ygQ_mvwy8iRje2kfvBDU191K2W10nV1rxUY7LDBYAFO2_vrb3CSJm33dMhigPk8880P4Fa8NTtrD8oMwAKEvYTeam1f4kFnhSTFPclakt2TdXb6uvOePuIHaRqYG2QgRcvcmGpl5td0MLNkXEH6g0I6an0cIXVy0vJVhSPTiDXyKN3JkLboqteWhXX57OT4zEmxvVF90bMnNbxDjlaJWy2hd4TWQDZnPcBsvBqMFMDxP0DfH50h9AHy7Ha8GwcQ9rKCLxwgjcb4LRuAl73SEpBFhq4ePntbqNP6HU827afsnrYvEgZppGPhNwVgfjydrFar82K33WbPOULhfwYpI6-WFH_83CsP3ww6AWyACf6UTGBJ0EQrp7BHUH4NPQ4_cx-lKwh9uMz0E4Z3i3T5ol1mQovsI6obzQ0K9Z888SEs8hLWRxfBwZUGqbYuI1X7H5j8ijl5Kr9g-etJavfbSvzEG-GDddJf7oc0AnvSHkCrg4wnb3hRZo39hTvHjO-tG7HdlAkW0A6SEZd05R84rzP4hgaUOZDiMVbh4N-NOglYHxYNLPdK-JDaKcR_JuY9Wofd7u_vCGWB0I2HyVnOuH4DNuFycgp7B--yiw78uU9Oc9fFNmjZUYmnSXUHGUI8EPEgHZzExks7Dols8vW6Kou6qtaJaApRFzVLggpaNhjD_V_fYxDVdmeZwKfgKWYJfiDHqgUmfrFOmnBOQJyhYybmCN8Xgem5JgdFMjvd7EOYfGz35WUZVNjPfNVZvNKP8Qk5ixSj-yU7DPpReT9Lj4vqjm7yZN-Ivue87zaizHtR94yysix41fV0U3JZikQzLrWP7AmlnGHsRqDHGAqlpxahI5qVIiZbjeofFpQ1UVm1iWpoRmme5ThnmJRVTkVf843o6g2rizuKWZQjU3oVia6sGxLXLJz5PHhUauWDvyqxjvFlWrIZ7bM57K1rDNZESM9mbZR0PlnCbJYY_wWhVaGR">