In the select_reg callback, I want to be able to determine if a given
node is already assigned, and if so what physical register has been
assigned.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
#include "util/bitset.h"
#include "register_allocate.h"
-#define NO_REG ~0U
-
struct ra_reg {
BITSET_WORD *conflicts;
unsigned int *conflict_list;
/** @{ Graph-coloring register allocation */
bool ra_allocate(struct ra_graph *g);
+#define NO_REG ~0U
+/**
+ * Returns NO_REG for a node that has not (yet) been assigned.
+ */
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);
void ra_set_node_spill_cost(struct ra_graph *g, unsigned int n, float cost);