[php-src] PR #23942: IR: Fuse loads from constant addresses that don't fit a displacement
| From: | ndossche | Date: | Sun, 27 Sep 2026 00:18:48 +0000 |
| Subject: | [php-src] PR #23942: IR: Fuse loads from constant addresses that don't fit a displacement | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38853@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23942
Author: ndossche
Should be upstreamed, but I first want to check the address on php
On x86-64, a load from a constant address was only fused into its user (e.g. a comparison) if the
address fits into a 32-bit displacement. Otherwise, the load was emitted separately into a register.
Fuse such loads too and load the address into a temporary register, using the existing constraints
of the fused load.
For example, the check of EG(vm_interrupt) in JIT code changes from
```asm
movabsq $EG(vm_interrupt), %rsi
movb (%rsi), %sil
testb %sil, %sil
jne ...
```
to
```asm
movabsq $EG(vm_interrupt), %rsi
cmpb $0, (%rsi)
jne ...
```
Similar for
EG(exception) checks etc.