r300: save pointer to register class list in the regalloc state
authorPavel Ondračka <pavel.ondracka@gmail.com>
Thu, 27 Oct 2022 19:57:11 +0000 (21:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Nov 2022 06:53:54 +0000 (06:53 +0000)
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19618>

src/gallium/drivers/r300/compiler/radeon_pair_regalloc.c
src/gallium/drivers/r300/compiler/radeon_regalloc.h

index c2ebf3f99a3ed87efb57344b10b28ebe227d2426..2f64dff4e2ab1d2d6ab07f0be342155409260c1c 100644 (file)
@@ -535,7 +535,7 @@ static void do_advanced_regalloc(struct regalloc_state * s)
                /* Compute the live intervals */
                rc_variable_compute_live_intervals(var_ptr->Item);
 
-               class_index = variable_get_class(var_ptr->Item, rc_class_list);
+               class_index = variable_get_class(var_ptr->Item, ra_state->class_list);
                node_classes[node_index] = ra_state->classes[class_index];
        }
 
@@ -696,9 +696,11 @@ void rc_init_regalloc_state(struct rc_regalloc_state *s)
        s->regs = ra_alloc_reg_set(NULL, R500_PFS_NUM_TEMP_REGS * RC_MASK_XYZW,
                                    true);
 
+       s->class_list = rc_class_list;
+
        /* Create the register classes */
        for (i = 0; i < RC_REG_CLASS_COUNT; i++) {
-               const struct rc_class *class = &rc_class_list[i];
+               const struct rc_class *class = &s->class_list[i];
                s->classes[class->ID] = ra_alloc_reg_class(s->regs);
 
                /* Assign registers to the classes */
index 6f12289e247bf9ba25819be93f8821599579fe5a..6c2f1cef2750498b284f54e5d56e832babe78ee5 100644 (file)
@@ -54,6 +54,7 @@ enum rc_reg_class {
 struct rc_regalloc_state {
        struct ra_regs *regs;
        struct ra_class *classes[RC_REG_CLASS_COUNT];
+       const struct rc_class *class_list;
 };
 
 void rc_init_regalloc_state(struct rc_regalloc_state *s);