Skip to content

Commit 6deaaf6

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Update IR
2 parents 2acda55 + 9fb355b commit 6deaaf6

File tree

3 files changed

+393
-139
lines changed

3 files changed

+393
-139
lines changed

ext/opcache/jit/ir/ir.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,12 @@ ir_ref ir_folding(ir_ctx *ctx, uint32_t opt, ir_ref op1, ir_ref op2, ir_ref op3,
10091009
ctx->prev_insn_chain[op] = ref;
10101010

10111011
return ref;
1012+
} else {
1013+
ctx->fold_insn.optx = opt;
1014+
ctx->fold_insn.op1 = op1;
1015+
ctx->fold_insn.op2 = op2;
1016+
ctx->fold_insn.op3 = op3;
1017+
return IR_FOLD_DO_CSE;
10121018
}
10131019
ir_fold_emit:
10141020
if (!(ctx->flags2 & IR_OPT_IN_SCCP)) {
@@ -1031,7 +1037,7 @@ ir_ref ir_folding(ir_ctx *ctx, uint32_t opt, ir_ref op1, ir_ref op2, ir_ref op3,
10311037
if (!(ctx->flags2 & IR_OPT_IN_SCCP)) {
10321038
return ir_const(ctx, val, IR_OPT_TYPE(opt));
10331039
} else {
1034-
ctx->fold_insn.type = IR_OPT_TYPE(opt);
1040+
ctx->fold_insn.opt = IR_OPT(IR_OPT_TYPE(opt), IR_OPT_TYPE(opt));
10351041
ctx->fold_insn.val.u64 = val.u64;
10361042
return IR_FOLD_DO_CONST;
10371043
}

ext/opcache/jit/ir/ir_check.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ bool ir_check(const ir_ctx *ctx)
106106
use = *p;
107107
if (use != IR_UNUSED) {
108108
if (IR_IS_CONST_REF(use)) {
109-
if (use >= ctx->consts_count) {
109+
if (IR_OPND_KIND(flags, j) != IR_OPND_DATA) {
110+
fprintf(stderr, "ir_base[%d].ops[%d] reference (%d) must not be constant\n", i, j, use);
111+
ok = 0;
112+
} else if (use >= ctx->consts_count) {
110113
fprintf(stderr, "ir_base[%d].ops[%d] constant reference (%d) is out of range\n", i, j, use);
111114
ok = 0;
112115
}

0 commit comments

Comments
 (0)