<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71667>71667</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[X86] Blockaddress offsets are lost when performing X86 LEA fixups with slow 3-ops LEAs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
momo5502
</td>
</tr>
</table>
<pre>
If there are indirect branches with blockaddresses, the X86FixupLEAs pass drops blockaddress offsets, when splitting up slow 3-ops LEAs, as can be seen in this example:
https://godbolt.org/z/bEsc3Poje
Before running the pass, the first instruction in bb.0 is a LEA with ebp, ebx and a blockaddress:
```
renamable $eax = LEA32r renamable $ebp, 1, renamable $ebx, target-flags(x86-gotoff) blockaddress(@square, %ir-block.1), $noreg
JMP32r killed renamable $eax
```
After the transformation, the blockaddress is missing:
```
renamable $eax = LEA32r renamable $ebx, 1, renamable $ebp, 0, $noreg
JMP32r killed renamable $eax
```
This only happens when `slow-3ops-lea` are enabled.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE-PuzYQ_TTmMiIC8ydw4LDb_JBatdIeetirjQfwrrGpxzTZfvrKJKs20f5uK0WOsP2G9x7zRhDpySJ2rHpm1SkRW5id7xa3uKrKeCKd-uh-HSHM6BGER9BWaY9DAOmFHWYkOOswgzRueBdKeSRCYvyXCIHXpu71ZVt___FEsAoiUN6tdHcb3DgShh1zntECrUaHoO0E2wpk3BmKNIJikXhJEAzCgkQgRAvaQpg1AV7EshpkxRPLTiy7rXMIK8U93jPeT05JZ8LB-Ynx_h_Ge_mDhuLFveH_Qc84Oo_gN2sjjagkkv9UNWpPAbSl4LchaLdzkPKQgSYQkefVE5RrhKC8gLAKxJ3sB56szm6__dGjFYuQBoHxEsUFWHGKhQvu4f7s-o48Lg8Hl52v8BOGdDRiIsabS1OnkwtuHBlv7_nwhpUZ_bUJjxHIeKV9ut845Iy3173SOo_TleNvf7xEOu_aGFTwyPhLWdf1aQzodyeDF5ZG5xcRbfz09647NMGiibSdvs2xy88c263MvlHpn7ExnTUfMIt1RUvXDmd1Fvs6LdxKqUHB6mzPFtpYVh0S1RWqLVqRYJfXbVuWZV20ydxVspFNUY7DUCteDJUSCuusOea8Ggo1tonueMaLPM-aPK-OeXto86Y8Vs2QYc0VNi0rM1yENgdj_l5iDhJNtGF3zOv6mBgh0dA-DDi3eIb9kHEeZ4PvIiaV20SszIymQP9VCTqYfYq8NjWrTvD8RcJ3jcZRuLqwoo-fPibstan32IxxWNwmykPyk82b7iHNOsybPAxuYbyPTG5_6erdGw6B8X7nT4z3u75_AwAA__8K_owz">