Skip to content

Commit

Permalink
Fix domintors tree construction (support for single block infinity loop)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Sep 17, 2024
1 parent d441328 commit 4f02f1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ir_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ int ir_build_dominators_tree(ir_ctx *ctx)
uint32_t idom = *p;
ir_block *idom_bb;

if (UNEXPECTED(idom > b)) {
if (UNEXPECTED(idom >= b)) {
/* In rare cases, LOOP_BEGIN.op1 may be a back-edge. Skip back-edges. */
ctx->flags2 &= ~IR_NO_LOOPS;
IR_ASSERT(k > 1 && "Wrong blocks order: BB is before its single predecessor");
Expand Down

0 comments on commit 4f02f1b

Please sign in to comment.