util/ra: move NO_REG to header
authorRob Clark <robdclark@chromium.org>
Mon, 9 Mar 2020 21:20:50 +0000 (14:20 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 16:01:39 +0000 (16:01 +0000)
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>

src/util/register_allocate.c
src/util/register_allocate.h

index 56517b5..4e97d82 100644 (file)
@@ -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;
index 7d8459b..c01f4ae 100644 (file)
@@ -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);