Mesa (master): util/ra: Add a getter for a node class

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 25 13:32:29 UTC 2019


Module: Mesa
Branch: master
Commit: b2a3ca6bd5008638acb3c0797a5658be67b96d86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2a3ca6bd5008638acb3c0797a5658be67b96d86

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Jul 24 11:19:21 2019 -0700

util/ra: Add a getter for a node class

Complements the existing getters and the setter for node class. To be
used in the Panfrost RA refactor.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/util/register_allocate.c | 7 +++++++
 src/util/register_allocate.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
index fe00af67283..b23bb377292 100644
--- a/src/util/register_allocate.c
+++ b/src/util/register_allocate.c
@@ -558,6 +558,13 @@ ra_set_node_class(struct ra_graph *g,
 }
 
 unsigned int
+ra_get_node_class(struct ra_graph *g,
+                  unsigned int n)
+{
+   return g->nodes[n].class;
+}
+
+unsigned int
 ra_add_node(struct ra_graph *g, unsigned int class)
 {
    unsigned int n = g->count;
diff --git a/src/util/register_allocate.h b/src/util/register_allocate.h
index 168c6e3535a..2cb57a1f0be 100644
--- a/src/util/register_allocate.h
+++ b/src/util/register_allocate.h
@@ -76,6 +76,7 @@ struct ra_graph *ra_alloc_interference_graph(struct ra_regs *regs,
                                              unsigned int count);
 void ra_resize_interference_graph(struct ra_graph *g, unsigned int count);
 void ra_set_node_class(struct ra_graph *g, unsigned int n, unsigned int c);
+unsigned int ra_get_node_class(struct ra_graph *g, unsigned int n);
 unsigned int ra_add_node(struct ra_graph *g, unsigned int c);
 void ra_set_select_reg_callback(struct ra_graph *g,
                                 unsigned int (*callback)(struct ra_graph *g,




More information about the mesa-commit mailing list