setup_payload_interference(g, first_payload_node, node_count);
- if (!ra_allocate_no_spills(g)) {
+ if (!ra_allocate(g)) {
/* Failed to allocate registers. Spill a reg, and the caller will
* loop back into here to try again.
*/
* means that either spilling will be required, or optimistic coloring
* should be applied.
*/
-bool
+static bool
ra_simplify(struct ra_graph *g)
{
bool progress = true;
* If all nodes were trivially colorable, then this must succeed. If
* not (optimistic coloring), then it may return false;
*/
-bool
+static bool
ra_select(struct ra_graph *g)
{
int i;
* locally-colorable and the rest of the register allocation
* will succeed.
*/
-void
+static void
ra_optimistic_color(struct ra_graph *g)
{
unsigned int i;
}
bool
-ra_allocate_no_spills(struct ra_graph *g)
+ra_allocate(struct ra_graph *g)
{
if (!ra_simplify(g)) {
ra_optimistic_color(g);
/* For any registers not in the stack to be colored, consider them for
* spilling. This will mostly collect nodes that were being optimistally
- * colored as part of ra_allocate_no_spills() if we didn't successfully
+ * colored as part of ra_allocate() if we didn't successfully
* optimistically color.
*
* It also includes nodes not trivially colorable by ra_simplify() if it
- * was used directly instead of as part of ra_allocate_no_spills().
+ * was used directly instead of as part of ra_allocate().
*/
for (n = 0; n < g->count; n++) {
float cost = g->nodes[n].spill_cost;
/** @} */
/** @{ Graph-coloring register allocation */
-bool ra_simplify(struct ra_graph *g);
-void ra_optimistic_color(struct ra_graph *g);
-bool ra_select(struct ra_graph *g);
-bool ra_allocate_no_spills(struct ra_graph *g);
+bool ra_allocate(struct ra_graph *g);
unsigned int ra_get_node_reg(struct ra_graph *g, unsigned int n);
void ra_set_node_reg(struct ra_graph * g, unsigned int n, unsigned int reg);