mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Use cfg_map if available
This commit is contained in:
parent
aba7818b00
commit
af7117a3b7
7
ir_ra.c
7
ir_ra.c
@ -2214,9 +2214,11 @@ static ir_live_pos ir_first_use_pos_after(ir_live_interval *ival, ir_live_pos po
|
||||
|
||||
static ir_block *ir_block_from_live_pos(ir_ctx *ctx, ir_live_pos pos)
|
||||
{
|
||||
ir_ref ref = IR_LIVE_POS_TO_REF(pos);
|
||||
|
||||
#ifdef IR_BITSET_LIVENESS
|
||||
uint32_t b;
|
||||
ir_block *bb;
|
||||
ir_ref ref = IR_LIVE_POS_TO_REF(pos);
|
||||
|
||||
// TODO: use binary search or map
|
||||
for (b = 1, bb = ctx->cfg_blocks + 1; b <= ctx->cfg_blocks_count; b++, bb++) {
|
||||
@ -2226,6 +2228,9 @@ static ir_block *ir_block_from_live_pos(ir_ctx *ctx, ir_live_pos pos)
|
||||
}
|
||||
IR_ASSERT(0);
|
||||
return NULL;
|
||||
#else
|
||||
return &ctx->cfg_blocks[ctx->cfg_map[ref]];
|
||||
#endif
|
||||
}
|
||||
|
||||
static ir_live_pos ir_find_optimal_split_position(ir_ctx *ctx, ir_live_interval *ival, ir_live_pos min_pos, ir_live_pos max_pos, bool prefer_max)
|
||||
|
Loading…
Reference in New Issue
Block a user