Skip to content

Avoid possible spill conflict (one of the problem that caused GH-16821) #16947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,13 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_
&& (jit->ssa->cfg.blocks[jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi->block].flags & ZEND_BB_LOOP_HEADER)) {
/* Avoid moving spill store out of loop */
return 1;
} else if (jit->ssa->vars[var].definition >= 0
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_def == var
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_use >= 0
&& jit->ssa->ops[jit->ssa->vars[var].definition].op2_use >= 0
&& jit->ra[jit->ssa->ops[jit->ssa->vars[var].definition].op2_use].ref == val) {
/* Avoid spill conflict between of ASSIGN.op1_def and ASSIGN.op1_use */
return 1;
}
return 0;
}
Expand Down