Disable LICM across an OSR ENTRY if the value can't be restored at OSR ENTRY point (support for nested loops)

This commit is contained in:
Dmitry Stogov 2023-04-25 21:54:30 +03:00
parent 7441eb2171
commit c2470bc684

View File

@ -131,6 +131,10 @@ static void ir_gcm_schedule_late(ir_ctx *ctx, uint32_t *_blocks, ir_bitset visit
while (lca != _blocks[ref]) { while (lca != _blocks[ref]) {
bb = &ctx->cfg_blocks[lca]; bb = &ctx->cfg_blocks[lca];
if (bb->loop_depth < loop_depth) { if (bb->loop_depth < loop_depth) {
if ((ctx->cfg_blocks[bb->loop_header].flags & IR_BB_LOOP_WITH_ENTRY)
&& !(ctx->binding && ir_binding_find(ctx, ref))) {
break;
}
loop_depth = bb->loop_depth; loop_depth = bb->loop_depth;
b = lca; b = lca;
if (!loop_depth) { if (!loop_depth) {