mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Update IR
IR commit: 673308a039eed5a2fdf4a2783b3dd3d6010a8c19
This commit is contained in:
parent
d17ed3445d
commit
5ed438fe07
2 changed files with 13 additions and 5 deletions
|
@ -1176,7 +1176,7 @@ void ir_build_def_use_lists(ir_ctx *ctx)
|
|||
use_list->count = 0;
|
||||
}
|
||||
|
||||
edges = ir_mem_malloc(edges_count * sizeof(ir_ref));
|
||||
edges = ir_mem_malloc(IR_ALIGNED_SIZE(edges_count * sizeof(ir_ref), 4096));
|
||||
for (i = IR_UNUSED + 1, insn = ctx->ir_base + i; i < ctx->insns_count;) {
|
||||
n = insn->inputs_count;
|
||||
for (j = n, p = insn->ops + 1; j > 0; j--, p++) {
|
||||
|
@ -1245,7 +1245,7 @@ void ir_build_def_use_lists(ir_ctx *ctx)
|
|||
}
|
||||
|
||||
ctx->use_edges_count = edges_count;
|
||||
edges = ir_mem_malloc(edges_count * sizeof(ir_ref));
|
||||
edges = ir_mem_malloc(IR_ALIGNED_SIZE(edges_count * sizeof(ir_ref), 4096));
|
||||
for (use_list = lists + ctx->insns_count - 1; use_list != lists; use_list--) {
|
||||
n = use_list->refs;
|
||||
if (n) {
|
||||
|
@ -1356,8 +1356,13 @@ bool ir_use_list_add(ir_ctx *ctx, ir_ref to, ir_ref ref)
|
|||
use_list->count++;
|
||||
return 0;
|
||||
} else {
|
||||
/* Reallocate the whole edges buffer (this is inefficient) */
|
||||
ctx->use_edges = ir_mem_realloc(ctx->use_edges, (ctx->use_edges_count + use_list->count + 1) * sizeof(ir_ref));
|
||||
size_t old_size = IR_ALIGNED_SIZE(ctx->use_edges_count * sizeof(ir_ref), 4096);
|
||||
size_t new_size = IR_ALIGNED_SIZE((ctx->use_edges_count + use_list->count + 1) * sizeof(ir_ref), 4096);
|
||||
|
||||
if (old_size < new_size) {
|
||||
/* Reallocate the whole edges buffer (this is inefficient) */
|
||||
ctx->use_edges = ir_mem_realloc(ctx->use_edges, new_size);
|
||||
}
|
||||
memcpy(ctx->use_edges + ctx->use_edges_count, ctx->use_edges + use_list->refs, use_list->count * sizeof(ir_ref));
|
||||
use_list->refs = ctx->use_edges_count;
|
||||
ctx->use_edges[use_list->refs + use_list->count] = ref;
|
||||
|
|
|
@ -566,6 +566,9 @@ static int ir_parallel_copy(ir_ctx *ctx, ir_copy *copies, int count, ir_reg tmp_
|
|||
if (IR_IS_TYPE_INT(type)) {
|
||||
#ifdef IR_HAVE_SWAP_INT
|
||||
if (pred[from] == to) {
|
||||
if (ir_type_size[types[to]] > ir_type_size[type]) {
|
||||
type = types[to];
|
||||
}
|
||||
ir_emit_swap(ctx, type, to, from);
|
||||
IR_REGSET_EXCL(todo, from);
|
||||
loc[to] = from;
|
||||
|
@ -579,7 +582,7 @@ static int ir_parallel_copy(ir_ctx *ctx, ir_copy *copies, int count, ir_reg tmp_
|
|||
loc[to] = tmp_reg;
|
||||
} else {
|
||||
#ifdef IR_HAVE_SWAP_FP
|
||||
if (pred[from] == to) {
|
||||
if (pred[from] == to && types[to] == type) {
|
||||
ir_emit_swap_fp(ctx, type, to, from);
|
||||
IR_REGSET_EXCL(todo, from);
|
||||
loc[to] = from;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue