mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Don't mark empty-loop block as empty in the first place
This commit is contained in:
parent
4569d58072
commit
b5c827ce25
4
ir_cfg.c
4
ir_cfg.c
@ -1162,10 +1162,6 @@ uint32_t ir_skip_empty_target_blocks(const ir_ctx *ctx, uint32_t b)
|
||||
bb = &ctx->cfg_blocks[b];
|
||||
|
||||
if ((bb->flags & (IR_BB_START|IR_BB_ENTRY|IR_BB_EMPTY)) == IR_BB_EMPTY) {
|
||||
if (ctx->cfg_edges[bb->successors] == b) {
|
||||
/* empty loop */
|
||||
break;
|
||||
}
|
||||
b = ctx->cfg_edges[bb->successors];
|
||||
} else {
|
||||
break;
|
||||
|
@ -609,7 +609,7 @@ int ir_match(ir_ctx *ctx)
|
||||
if (insn->op == IR_END || insn->op == IR_LOOP_END) {
|
||||
ctx->rules[ref] = insn->op;
|
||||
ref = prev_ref[ref];
|
||||
if (ref == start) {
|
||||
if (ref == start && ctx->cfg_edges[bb->successors] != b) {
|
||||
if (EXPECTED(!(bb->flags & IR_BB_ENTRY))) {
|
||||
bb->flags |= IR_BB_EMPTY;
|
||||
} else if (ctx->flags & IR_MERGE_EMPTY_ENTRIES) {
|
||||
|
Loading…
Reference in New Issue
Block a user