Repository navigation
Conversation
Check the Phi use's ENTRY block and walk incoming edges for uses in the definition block. This keeps loop-carried values in memory across user calls, while preserving zero-length Pi intervals. DO_UCALL, DO_FCALL, and DO_FCALL_BY_NAME reproduce the bug; yield and include do not. Fixes phpGH-25164
iliaal
force-pushed
the
fix/gh-25164-jit-entry-phi-liveness
branch
from
November 3, 2026 18:26
b0d9797 to
658d9a8
Compare
Owner
Author
|
Promoted to php#25178. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zend_jit_may_be_in_reg()keeps a value in a register only if its live range doesn't cross an ENTRY block, but the phi-use walk skipped a phi located in the ENTRY block itself and a phi in the value's own definition block. A user call leaves the JIT code and comes back through an ENTRY block, so$iinwhile ($i++ < 5) leaf();stayed in a clobbered register and the loop ran once or forever underopcache.jit=functionand1203.For a Pi in the definition block the walk follows only its real incoming edge (
p->pi), since SSA copies a Pi's source into every predecessor slot. Register allocation over the ext/opcache/tests/jit bodies is unchanged except in the new test.Reproduced on PHP-8.4 and master debug builds (x86-64, hybrid VM). php#18392 doesn't fix it.
Fixes phpGH-25164