Skip to content

opcache: preserve cv values across jit assignments and cse - #25136

Open
aasul wants to merge 1 commit into
php:PHP-8.4from
aasul:codex/gh24683-ac-84
Open

aasul wants to merge 1 commit into
php:PHP-8.4from
aasul:codex/gh24683-ac-84

Conversation

@aasul

@aasul aasul commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

this fixes the A and C tracing jit failures from GH-24683.

for A, assignment handling can create redundant copies of identical typed constants that end up overwriting a live cv value before a trace guard or side exit.

for C, a reusable expression can remain bound to a cv spill slot even after that cv has been assigned a different value. later cse reuse can then corrupt the observable state.

the changes preserve the constant identity where appropriate, separate reusable expression values from their cv assignments, and safely share spill storage when the optimized live ranges allow it.

i've included regression tests for the original failures, floating-point cse, and spill-frame pressure.

@ChrisOrlando independently tested A+C on an apple m1 against php 8.5.12. A went from 9 wrong results to 0, and C went from 939 wrong results to 0. the larger workload also matched the jit-off result.

B is handled separately in #25085. the combined A+C+B patches fix all three original reproductions.

refs GH-24683.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 19:46
@aasul
aasul requested a review from dstogov as a code owner November 1, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants