From dd2e050a8422aed2f4de601b3894cbba94ba30bb Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 9 Mar 2020 14:20:50 -0700 Subject: [PATCH] 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: --- src/util/register_allocate.c | 2 -- src/util/register_allocate.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) 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); -- 2.30.2