From: Rob Clark Date: Mon, 9 Mar 2020 21:20:50 +0000 (-0700) Subject: util/ra: move NO_REG to header X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd2e050a8422aed2f4de601b3894cbba94ba30bb;p=mesa.git util/ra: move NO_REG to header 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 Part-of: --- diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c index 56517b5161c..4e97d82f23e 100644 --- a/src/util/register_allocate.c +++ b/src/util/register_allocate.c @@ -78,8 +78,6 @@ #include "util/bitset.h" #include "register_allocate.h" -#define NO_REG ~0U - struct ra_reg { BITSET_WORD *conflicts; unsigned int *conflict_list; diff --git a/src/util/register_allocate.h b/src/util/register_allocate.h index 7d8459b1eff..c01f4aee47a 100644 --- a/src/util/register_allocate.h +++ b/src/util/register_allocate.h @@ -114,6 +114,10 @@ void ra_reset_node_interference(struct ra_graph *g, unsigned int n); /** @{ 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);