<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87444>87444</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[PowerPC] LI folding opportunity
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:PowerPC
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chenzheng1030
</td>
</tr>
</table>
<pre>
See https://github.com/llvm/llvm-project/pull/86857/files#r1548822138
If we know the lowest bit of gpr5 is 0( slwi 5, 6, 1), PPC should be able to fold
```
li 3, 1
rlwimi 3, 5, 0, 0, 30
```
to
```
addi 3, 5, 1
```
Or
```
ori 3, 5, 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkt-qnDAQxp8m3gxd4iRR98KL7S7CgUIX-gTGjJqerJEkVk6fvuju6T_25oB8w4wzXwbm18Zoh4moZuozU5esXdLoQ92NNP0caRpyLnimvXmrvxHBmNIcmTgxbBg2g03jog-dvzFsnPvxHj7NwX-nLjFs5sU5hk1VVKpk2PTWUWQoQq5kVSHmomL8wvjpri89rASvk18hjQTOrxQTaJvA9zDMQYGNwBlWEN1qQTE8Q7FJzvC4xev1DHH0izOgCVrtCJKH3jvzeKbgj29PnQVxH9_T4FZ7e5R2b_5bBH9qkPzTcmvM3zb506a7fg1Pf_rwjwH815SZWpijOLYZ1XmZY55zoY7ZWJuyV6Xs2rbsUElRFkabQhEJbXrUoshsjRwll1xwzFEcD6SFqgyvpESFHXZMcrq11h22Sx58GDIb40J1VUopM9dqcnGHBVG33StNhonT1a8UrmeGuDEU6p0CvQyRSe5sTPGPW7LJ7bS9z6gLfHnZb2SnAfw8-5CWyaa3bAmu_jBx-7ZxY25b-FcAAAD__ynBz50">