mirror of
https://github.com/danog/ir.git
synced 2024-11-26 20:34:53 +01:00
Reuse ir_ctx.prev_ref if the schedule wasn't changed
This commit is contained in:
parent
bdb8e6a1da
commit
6f8012756e
7
ir_gcm.c
7
ir_gcm.c
@ -540,10 +540,6 @@ restart:
|
||||
}
|
||||
#endif
|
||||
|
||||
ir_mem_free(_prev);
|
||||
|
||||
/* TODO: linearize without reallocation and reconstruction ??? */
|
||||
|
||||
#if 1
|
||||
if (consts_count == ctx->consts_count && insns_count == ctx->insns_count) {
|
||||
bool changed = 0;
|
||||
@ -561,6 +557,7 @@ restart:
|
||||
ir_mem_free(_xlat);
|
||||
ir_mem_free(_next);
|
||||
|
||||
ctx->prev_ref = _prev;
|
||||
ctx->flags |= IR_LINEAR;
|
||||
ir_truncate(ctx);
|
||||
|
||||
@ -569,6 +566,8 @@ restart:
|
||||
}
|
||||
#endif
|
||||
|
||||
ir_mem_free(_prev);
|
||||
|
||||
ir_init(&new_ctx, consts_count, insns_count);
|
||||
new_ctx.insns_count = insns_count;
|
||||
new_ctx.flags = ctx->flags;
|
||||
|
Loading…
Reference in New Issue
Block a user