pan/midgard: Move bounds checking into LCRA
This simplifies the cost calculation code a bit. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
@@ -197,7 +197,8 @@ lcra_solve(struct lcra_state *l)
|
||||
void
|
||||
lcra_set_node_spill_cost(struct lcra_state *l, unsigned node, signed cost)
|
||||
{
|
||||
l->spill_cost[node] = cost;
|
||||
if (node < l->node_count)
|
||||
l->spill_cost[node] = cost;
|
||||
}
|
||||
|
||||
/* Count along the lower triangle */
|
||||
|
||||
@@ -689,15 +689,10 @@ mir_choose_spill_node(
|
||||
|
||||
mir_foreach_instr_global(ctx, ins) {
|
||||
if (ins->no_spill) {
|
||||
if (ins->dest < ctx->temp_count)
|
||||
lcra_set_node_spill_cost(l, ins->dest, -1);
|
||||
lcra_set_node_spill_cost(l, ins->dest, -1);
|
||||
|
||||
mir_foreach_src(ins, s) {
|
||||
unsigned src = ins->src[s];
|
||||
|
||||
if (src < ctx->temp_count)
|
||||
lcra_set_node_spill_cost(l, src, -1);
|
||||
}
|
||||
mir_foreach_src(ins, s)
|
||||
lcra_set_node_spill_cost(l, ins->src[s], -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user