class fs_reg_alloc {
public:
fs_reg_alloc(fs_visitor *fs):
- fs(fs), devinfo(fs->devinfo), compiler(fs->compiler), g(NULL)
+ fs(fs), devinfo(fs->devinfo), compiler(fs->compiler), g(NULL),
+ have_spill_costs(false)
{
mem_ctx = ralloc_context(NULL);
int rsi;
ra_graph *g;
+ bool have_spill_costs;
int payload_node_count;
int *payload_last_use_ip;
*/
foreach_block_and_inst(block, fs_inst, inst, fs->cfg)
setup_inst_interference(inst);
-
- if (allow_spilling)
- set_spill_costs();
}
void
{
ralloc_free(g);
g = NULL;
+ have_spill_costs = false;
}
static void
if (!no_spill[i])
ra_set_node_spill_cost(g, first_vgrf_node + i, adjusted_cost);
}
+
+ have_spill_costs = true;
}
int
fs_reg_alloc::choose_spill_reg()
{
+ if (!have_spill_costs)
+ set_spill_costs();
+
int node = ra_get_best_spill_node(g);
if (node < 0)
return -1;