int setup_attributes(int payload_reg);
int setup_uniforms(int payload_reg);
void setup_payload();
- void reg_allocate_trivial();
- void reg_allocate();
+ bool reg_allocate_trivial();
+ bool reg_allocate();
void evaluate_spill_costs(float *spill_costs, bool *no_spill);
int choose_spill_reg(struct ra_graph *g);
void spill_reg(int spill_reg);
}
}
-void
+bool
vec4_visitor::reg_allocate_trivial()
{
unsigned int hw_reg_mapping[this->virtual_grf_count];
if (prog_data->total_grf > max_grf) {
fail("Ran out of regs on trivial allocator (%d/%d)\n",
prog_data->total_grf, max_grf);
+ return false;
}
+
+ return true;
}
static void
ra_set_finalize(brw->vs.regs, NULL);
}
-void
+bool
vec4_visitor::reg_allocate()
{
unsigned int hw_reg_mapping[virtual_grf_count];
/* Using the trivial allocator can be useful in debugging undefined
* register access as a result of broken optimization passes.
*/
- if (0) {
- reg_allocate_trivial();
- return;
- }
+ if (0)
+ return reg_allocate_trivial();
calculate_live_intervals();
spill_reg(reg);
}
ralloc_free(g);
- return;
+ return false;
}
/* Get the chosen virtual registers for each node, and map virtual
}
ralloc_free(g);
+
+ return true;
}
void