r300/compiler: refactor vertex shader compilation
authorMarek Olšák <maraeo@gmail.com>
Wed, 1 Sep 2010 01:19:05 +0000 (03:19 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 4 Sep 2010 16:56:21 +0000 (18:56 +0200)
First list compiler passes in an array, then run the new function rc_run_compiler.
Every backend may need a different set of passes.
This cleans up the mess in r3xx_compile_vertex_program.

18 files changed:
src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c
src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h
src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c
src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.c
src/mesa/drivers/dri/r300/compiler/radeon_emulate_branches.h
src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c
src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.h
src/mesa/drivers/dri/r300/compiler/radeon_program.c
src/mesa/drivers/dri/r300/compiler/radeon_program.h
src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h
src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c
src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.h

index 45d51b98351c589d37e823e0339ea8481ad3ee24..a3c34beb02f8a71f6623804fac0aed0bd4735b13 100644 (file)
@@ -111,10 +111,10 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
                rc_unroll_loops(&c->Base);
                debug_program_log(c, "after unroll loops");
        } else {
-               rc_transform_loops(&c->Base);
+               rc_transform_loops(&c->Base, NULL);
                debug_program_log(c, "after transform loops");
 
-               rc_emulate_branches(&c->Base);
+               rc_emulate_branches(&c->Base, NULL);
                debug_program_log(c, "after emulate branches");
        }
 
@@ -126,7 +126,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
                        { &radeonTransformTrigScale, 0 },
                        { 0, 0 }
                };
-               radeonLocalTransform(&c->Base, transformations);
+               rc_local_transform(&c->Base, transformations);
 
                debug_program_log(c, "after native rewrite part 1");
 
@@ -134,10 +134,10 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
        } else {
                struct radeon_program_transformation transformations[] = {
                        { &radeonTransformALU, 0 },
-                       { &radeonTransformTrigSimple, 0 },
+                       { &r300_transform_trig_simple, 0 },
                        { 0, 0 }
                };
-               radeonLocalTransform(&c->Base, transformations);
+               rc_local_transform(&c->Base, transformations);
 
                debug_program_log(c, "after native rewrite part 1");
 
@@ -150,10 +150,10 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
                { &radeonTransformTEX, c },
                { 0, 0 }
        };
-       radeonLocalTransform(&c->Base, common_transformations);
+       rc_local_transform(&c->Base, common_transformations);
 
        common_transformations[0].function = &radeonTransformALU;
-       radeonLocalTransform(&c->Base, common_transformations);
+       rc_local_transform(&c->Base, common_transformations);
 
        if (c->Base.Error)
                return;
@@ -175,7 +175,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
 
        debug_program_log(c, "after dataflow optimize");
 
-       rc_dataflow_swizzles(&c->Base);
+       rc_dataflow_swizzles(&c->Base, NULL);
        if (c->Base.Error)
                return;
 
index d56ba7f46288d9c229a150a1f0da75a65cc76cec..eb35265e37ed85b105df328ccfa3d87d74846906 100644 (file)
@@ -462,8 +462,9 @@ static void ei_endif(struct r300_vertex_program_compiler *compiler,
        inst[3] = 0;
 }
 
-static void translate_vertex_program(struct r300_vertex_program_compiler * compiler)
+static void translate_vertex_program(struct radeon_compiler *c, void *user)
 {
+       struct r300_vertex_program_compiler *compiler = (struct r300_vertex_program_compiler*)c;
        struct rc_instruction *rci;
 
        struct loop * loops = NULL;
@@ -637,8 +638,9 @@ struct temporary_allocation {
        struct rc_instruction * LastRead;
 };
 
-static void allocate_temporary_registers(struct r300_vertex_program_compiler * compiler)
+static void allocate_temporary_registers(struct radeon_compiler *c, void *user)
 {
+       struct r300_vertex_program_compiler *compiler = (struct r300_vertex_program_compiler*)c;
        struct rc_instruction *inst;
        struct rc_instruction *end_loop = NULL;
        unsigned int num_orig_temps = 0;
@@ -849,8 +851,9 @@ static int transform_source_conflicts(
        return 1;
 }
 
-static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler)
+static void rc_vs_add_artificial_outputs(struct radeon_compiler *c, void *user)
 {
+       struct r300_vertex_program_compiler * compiler = (struct r300_vertex_program_compiler*)c;
        int i;
 
        for(i = 0; i < 32; ++i) {
@@ -926,8 +929,9 @@ static void transform_negative_addressing(struct r300_vertex_program_compiler *c
        }
 }
 
-static void rc_emulate_negative_addressing(struct r300_vertex_program_compiler *c)
+static void rc_emulate_negative_addressing(struct radeon_compiler *compiler, void *user)
 {
+       struct r300_vertex_program_compiler * c = (struct r300_vertex_program_compiler*)compiler;
        struct rc_instruction *inst, *lastARL = NULL;
        int min_offset = 0;
 
@@ -962,144 +966,78 @@ static void rc_emulate_negative_addressing(struct r300_vertex_program_compiler *
                transform_negative_addressing(c, lastARL, inst, min_offset);
 }
 
-static void debug_program_log(struct r300_vertex_program_compiler* c, const char * where)
-{
-       if (c->Base.Debug) {
-               fprintf(stderr, "Vertex Program: %s\n", where);
-               rc_print_program(&c->Base.Program);
-       }
-}
-
-
 static struct rc_swizzle_caps r300_vertprog_swizzle_caps = {
        .IsNative = &swizzle_is_native,
        .Split = 0 /* should never be called */
 };
 
-
-void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c)
+static void validate_final_shader(struct radeon_compiler *c, void *user)
 {
-       c->Base.SwizzleCaps = &r300_vertprog_swizzle_caps;
-
-       addArtificialOutputs(c);
-
-       debug_program_log(c, "before compilation");
-
-       rc_transform_loops(&c->Base);
-       if (c->Base.Error)
-               return;
-
-       debug_program_log(c, "after emulate loops");
-
-       if (!c->Base.is_r500) {
-               rc_emulate_branches(&c->Base);
-               if (c->Base.Error)
-                       return;
-               debug_program_log(c, "after emulate branches");
-       }
-
-       rc_emulate_negative_addressing(c);
-
-       debug_program_log(c, "after negative addressing emulation");
-
-       if (c->Base.is_r500) {
-               struct radeon_program_transformation transformations[] = {
-                       { &r300_transform_vertex_alu, 0 },
-                       { &r300_transform_trig_scale_vertex, 0 },
-                       { 0, 0 }
-               };
-               radeonLocalTransform(&c->Base, transformations);
-               if (c->Base.Error)
-                       return;
-
-               debug_program_log(c, "after native rewrite");
-       } else {
-               struct radeon_program_transformation transformations[] = {
-                       { &r300_transform_vertex_alu, 0 },
-                       { &radeonTransformTrigSimple, 0 },
-                       { 0, 0 }
-               };
-               radeonLocalTransform(&c->Base, transformations);
-               if (c->Base.Error)
-                       return;
-
-               debug_program_log(c, "after native rewrite");
-
-               /* Note: This pass has to be done seperately from ALU rewrite,
-                * because it needs to check every instruction.
-                */
-               struct radeon_program_transformation transformations2[] = {
-                       { &transform_nonnative_modifiers, 0 },
-                       { 0, 0 }
-               };
-               radeonLocalTransform(&c->Base, transformations2);
-               if (c->Base.Error)
-                       return;
-
-               debug_program_log(c, "after emulate modifiers");
-       }
-
-       {
-               /* Note: This pass has to be done seperately from ALU rewrite,
-                * otherwise non-native ALU instructions with source conflits
-                * will not be treated properly.
-                */
-               struct radeon_program_transformation transformations[] = {
-                       { &transform_source_conflicts, 0 },
-                       { 0, 0 }
-               };
-               radeonLocalTransform(&c->Base, transformations);
-               if (c->Base.Error)
-                       return;
+       /* Check the number of constants. */
+       if (c->Program.Constants.Count > 256) {
+               rc_error(c, "Too many constants. Max: 256, Got: %i\n",
+                        c->Program.Constants.Count);
        }
+}
 
-       debug_program_log(c, "after source conflict resolve");
-
-       rc_dataflow_deadcode(&c->Base, &dataflow_outputs_mark_used);
-       if (c->Base.Error)
-               return;
-
-       debug_program_log(c, "after deadcode");
-
-       rc_dataflow_swizzles(&c->Base);
-       if (c->Base.Error)
-               return;
-
-       debug_program_log(c, "after dataflow");
-
-       allocate_temporary_registers(c);
-       if (c->Base.Error)
-               return;
-
-       debug_program_log(c, "after register allocation");
-
-       if (c->Base.remove_unused_constants) {
-               rc_remove_unused_constants(&c->Base,
-                                          &c->code->constants_remap_table);
-               if (c->Base.Error)
-                       return;
-
-               debug_program_log(c, "after constants cleanup");
-       }
+void r3xx_compile_vertex_program(struct r300_vertex_program_compiler *c)
+{
+       int is_r500 = c->Base.is_r500;
+       int kill_consts = c->Base.remove_unused_constants;
+
+       /* Lists of instruction transformations. */
+       struct radeon_program_transformation alu_rewrite_r500[] = {
+               { &r300_transform_vertex_alu, 0 },
+               { &r300_transform_trig_scale_vertex, 0 },
+               { 0, 0 }
+       };
+
+       struct radeon_program_transformation alu_rewrite_r300[] = {
+               { &r300_transform_vertex_alu, 0 },
+               { &r300_transform_trig_simple, 0 },
+               { 0, 0 }
+       };
+
+       /* Note: These passes have to be done seperately from ALU rewrite,
+        * otherwise non-native ALU instructions with source conflits
+        * or non-native modifiers will not be treated properly.
+        */
+       struct radeon_program_transformation emulate_modifiers[] = {
+               { &transform_nonnative_modifiers, 0 },
+               { 0, 0 }
+       };
+
+       struct radeon_program_transformation resolve_src_conflicts[] = {
+               { &transform_source_conflicts, 0 },
+               { 0, 0 }
+       };
+
+       /* List of compiler passes. */
+       struct radeon_compiler_pass vs_list[] = {
+               /* NAME                         DUMP PREDICATE  FUNCTION                        PARAM */
+               {"add artificial outputs",      0, 1,           rc_vs_add_artificial_outputs,   NULL},
+               {"transform loops",             1, 1,           rc_transform_loops,             NULL},
+               {"emulate branches",            1, !is_r500,    rc_emulate_branches,            NULL},
+               {"emulate negative addressing", 1, 1,           rc_emulate_negative_addressing, NULL},
+               {"native rewrite",              1, is_r500,     rc_local_transform,             alu_rewrite_r500},
+               {"native rewrite",              1, !is_r500,    rc_local_transform,             alu_rewrite_r300},
+               {"emulate modifiers",           1, !is_r500,    rc_local_transform,             emulate_modifiers},
+               {"source conflict resolve",     1, 1,           rc_local_transform,             resolve_src_conflicts},
+               {"deadcode",                    1, 1,           rc_dataflow_deadcode,           dataflow_outputs_mark_used},
+               {"dataflow swizzles",           1, 1,           rc_dataflow_swizzles,           NULL},
+               {"register allocation",         1, 1,           allocate_temporary_registers,   NULL},
+               {"dead constants",              1, kill_consts, rc_remove_unused_constants,     &c->code->constants_remap_table},
+               {"final code validation",       0, 1,           validate_final_shader,          NULL},
+               {"machine code generation",     0, 1,           translate_vertex_program,       NULL},
+               {"dump machine code",           0,c->Base.Debug,r300_vertex_program_dump,       NULL},
+               {NULL, 0, 0, NULL, NULL}
+       };
 
-       translate_vertex_program(c);
-       if (c->Base.Error)
-               return;
+       c->Base.SwizzleCaps = &r300_vertprog_swizzle_caps;
 
-       rc_constants_copy(&c->code->constants, &c->Base.Program.Constants);
+       rc_run_compiler(&c->Base, vs_list, "Vertex Program");
 
        c->code->InputsRead = c->Base.Program.InputsRead;
        c->code->OutputsWritten = c->Base.Program.OutputsWritten;
-
-       if (c->Base.Debug) {
-               fprintf(stderr, "Final vertex program code:\n");
-               r300_vertex_program_dump(c);
-       }
-
-       /* Check the number of constants. */
-       if (!c->Base.Error &&
-           c->Base.Program.Constants.Count > 256) {
-               rc_error(&c->Base, "Too many constants. Max: 256, Got: %i\n",
-                        c->Base.Program.Constants.Count);
-       }
+       rc_constants_copy(&c->code->constants, &c->Base.Program.Constants);
 }
index e6009338e2ec74c3630f6a36ffb1865f4b2f74ed..2bc0a87eed813178164a3a20244a2e371d172d29 100644 (file)
@@ -166,12 +166,15 @@ static void r300_vs_src_dump(uint32_t src)
                        r300_vs_swiz_debug[(src >> 22) & 0x7]);
 }
 
-void r300_vertex_program_dump(struct r300_vertex_program_compiler * c)
+void r300_vertex_program_dump(struct radeon_compiler *compiler, void *user)
 {
+       struct r300_vertex_program_compiler *c = (struct r300_vertex_program_compiler*)compiler;
        struct r300_vertex_program_code * vs = c->code;
        unsigned instrcount = vs->length / 4;
        unsigned i;
 
+       fprintf(stderr, "Final vertex program code:\n");
+
        for(i = 0; i < instrcount; i++) {
                unsigned offset = i*4;
                unsigned src;
index 935dc9b0a806e5e9f6a8e2c8c686eb7f589c5405..4aff69c86836c5be4193949ee33b324725176922 100644 (file)
@@ -350,3 +350,27 @@ void rc_transform_fragment_face(struct radeon_compiler *c, unsigned face)
                }
        }
 }
+
+/* Executes a list of compiler passes given in the parameter 'list'. */
+void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list,
+                    const char *shader_name)
+{
+       if (c->Debug) {
+               fprintf(stderr, "%s: before compilation\n", shader_name);
+               rc_print_program(&c->Program);
+       }
+
+       for (unsigned i = 0; list[i].name; i++) {
+               if (list[i].predicate) {
+                       list[i].run(c, list[i].user);
+
+                       if (c->Error)
+                               return;
+
+                       if (c->Debug && list[i].dump) {
+                               fprintf(stderr, "%s: after '%s'\n", shader_name, list[i].name);
+                               rc_print_program(&c->Program);
+                       }
+               }
+       }
+}
index 1833fcebcac1981df13a7858966bf83d3b6e56a1..0f6ad278b101e0972259e315db6edb11601ae90f 100644 (file)
@@ -123,6 +123,18 @@ struct r300_vertex_program_compiler {
 };
 
 void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* c);
-void r300_vertex_program_dump(struct r300_vertex_program_compiler * c);
+void r300_vertex_program_dump(struct radeon_compiler *compiler, void *user);
+
+struct radeon_compiler_pass {
+       const char *name;       /* Name of the pass. */
+       int dump;               /* Dump the program if Debug == 1? */
+       int predicate;          /* Run this pass? */
+       void (*run)(struct radeon_compiler *c, void *user); /* The main entrypoint. */
+       void *user;             /* Optional parameter which is passed to the run function. */
+};
+
+/* Executes a list of compiler passes given in the parameter 'list'. */
+void rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list,
+                    const char *shader_name);
 
 #endif /* RADEON_COMPILER_H */
index 41501e0551b2e2201825b72f8cbc899a304b26ff..7a7a33ec71341ec9f4fafa1ec72c529539121b31 100644 (file)
@@ -61,8 +61,8 @@ void rc_remap_registers(struct rc_instruction * inst, rc_remap_register_fn cb, v
 /*@{*/
 typedef void (*rc_dataflow_mark_outputs_fn)(void * userdata, void * data,
                        void (*mark_fn)(void * data, unsigned int index, unsigned int mask));
-void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce);
-void rc_dataflow_swizzles(struct radeon_compiler * c);
+void rc_dataflow_deadcode(struct radeon_compiler * c, void *user);
+void rc_dataflow_swizzles(struct radeon_compiler * c, void *user);
 /*@}*/
 
 void rc_optimize(struct radeon_compiler * c);
index d27d857721ef7b1a41a8bf793cd2d2b5a97e9e94..701092b625e9b6078af95cedec187c83f5f653f5 100644 (file)
@@ -213,11 +213,12 @@ static void mark_output_use(void * data, unsigned int index, unsigned int mask)
        mark_used(s, RC_FILE_OUTPUT, index, mask);
 }
 
-void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce)
+void rc_dataflow_deadcode(struct radeon_compiler * c, void *user)
 {
        struct deadcode_state s;
        unsigned int nr_instructions;
        unsigned has_temp_reladdr_src = 0;
+       rc_dataflow_mark_outputs_fn dce = (rc_dataflow_mark_outputs_fn)user;
 
        memset(&s, 0, sizeof(s));
        s.C = c;
index 33acbd30f44116e67ae1abf5018a1f076ac8206c..a0f7bd81741ed3da80cc28e4c7de2bbc2b61f9e1 100644 (file)
@@ -86,7 +86,7 @@ static void rewrite_source(struct radeon_compiler * c,
        }
 }
 
-void rc_dataflow_swizzles(struct radeon_compiler * c)
+void rc_dataflow_swizzles(struct radeon_compiler * c, void *user)
 {
        struct rc_instruction * inst;
 
index 863654cf6850651262f5cbfe72f6842063d25b56..222e5b7e02ba68697cd2cc76695b0e33f21a4f73 100644 (file)
@@ -296,7 +296,7 @@ static void fix_output_writes(struct emulate_branch_state * s, struct rc_instruc
  * on different register sets and choose between their results
  * using CMP instructions in place of the original ENDIF.
  */
-void rc_emulate_branches(struct radeon_compiler * c)
+void rc_emulate_branches(struct radeon_compiler *c, void *user)
 {
        struct emulate_branch_state s;
 
index e07279f0933c9ba33f18157249251d5518e1105b..818ab84d0cd049cc312eee1ae391b8b92f7fe790 100644 (file)
@@ -25,6 +25,6 @@
 
 struct radeon_compiler;
 
-void rc_emulate_branches(struct radeon_compiler * c);
+void rc_emulate_branches(struct radeon_compiler *c, void *user);
 
 #endif /* RADEON_EMULATE_BRANCHES_H */
index d13b2be42db78d7231dc2d06290342433c450c0f..026556f319f757e952163cbf0893c6de808acf63 100644 (file)
@@ -470,7 +470,7 @@ static int transform_loop(struct emulate_loop_state * s,
        return 1;
 }
 
-void rc_transform_loops(struct radeon_compiler *c)
+void rc_transform_loops(struct radeon_compiler *c, void *user)
 {
        struct emulate_loop_state * s = &c->loop_state;
        struct rc_instruction * ptr;
index caf1c576588f20ff4c2d009530a7c577415db175..4e37330f81a13ef0a7071ef0389bf07434346cba 100644 (file)
@@ -23,7 +23,7 @@ struct emulate_loop_state {
        unsigned int LoopReserved;
 };
 
-void rc_transform_loops(struct radeon_compiler *c);
+void rc_transform_loops(struct radeon_compiler *c, void *user);
 
 void rc_unroll_loops(struct radeon_compiler * c);
 
index 9ab52b64eafbdc4c982d92576a6eda328ac693b6..24b685fbeb4a4cd51df2067b0223cb9f2ba7fb03 100644 (file)
  * \note The transform is called 'local' because it can only look at
  * one instruction at a time.
  */
-void radeonLocalTransform(
+void rc_local_transform(
        struct radeon_compiler * c,
-       struct radeon_program_transformation* transformations)
+       void *user)
 {
+       struct radeon_program_transformation *transformations =
+               (struct radeon_program_transformation*)user;
        struct rc_instruction * inst = c->Program.Instructions.Next;
 
        while(inst != &c->Program.Instructions) {
index 56740643f293290f511727bc10c2b43fe71d86dd..ee4fe8192e23a08636fabef81952418df6fead09 100644 (file)
@@ -197,7 +197,7 @@ static inline void reset_srcreg(struct rc_src_register* reg)
 
 
 /**
- * A transformation that can be passed to \ref radeonLocalTransform.
+ * A transformation that can be passed to \ref rc_local_transform.
  *
  * The function will be called once for each instruction.
  * It has to either emit the appropriate transformed code for the instruction
@@ -214,9 +214,9 @@ struct radeon_program_transformation {
        void *userData;
 };
 
-void radeonLocalTransform(
+void rc_local_transform(
        struct radeon_compiler *c,
-       struct radeon_program_transformation* transformations);
+       void *user);
 
 unsigned int rc_find_free_temporary(struct radeon_compiler * c);
 
index 704a7bb2d231eb7881166aa58bdb69cd2380ea51..bdff995b071506a69028912152f17f229bd3db02 100644 (file)
@@ -770,7 +770,7 @@ static void transform_r300_vertex_SSG(struct radeon_compiler* c,
 }
 
 /**
- * For use with radeonLocalTransform, this transforms non-native ALU
+ * For use with rc_local_transform, this transforms non-native ALU
  * instructions of the r300 up to r500 vertex engine.
  */
 int r300_transform_vertex_alu(
@@ -870,7 +870,7 @@ static void sin_approx(
  * using only the basic instructions
  *  MOV, ADD, MUL, MAD, FRC
  */
-int radeonTransformTrigSimple(struct radeon_compiler* c,
+int r300_transform_trig_simple(struct radeon_compiler* c,
        struct rc_instruction* inst,
        void* unused)
 {
index e6e2cc20c5ab42657931432d2067c8c1afc542b8..903f13746de0c7bf917856629496e2c99a7ee9b1 100644 (file)
@@ -40,7 +40,7 @@ int r300_transform_vertex_alu(
        struct rc_instruction * inst,
        void*);
 
-int radeonTransformTrigSimple(
+int r300_transform_trig_simple(
        struct radeon_compiler * c,
        struct rc_instruction * inst,
        void*);
index be89e9fa5b41db83effd8471e8c5238fb3324637..9281feecfa180ef59026e5574740cdea58683c85 100644 (file)
@@ -27,9 +27,9 @@
 
 #include "radeon_remove_constants.h"
 
-void rc_remove_unused_constants(struct radeon_compiler *c,
-                                unsigned **out_remap_table)
+void rc_remove_unused_constants(struct radeon_compiler *c, void *user)
 {
+       unsigned **out_remap_table = (unsigned**)user;
         unsigned char *const_used;
         unsigned *remap_table;
         unsigned *inv_remap_table;
index 0d3a26ca1ca45176bd72be62867ff9d8c2fa110c..f29113b922b597e78adfda5ce773dbc7605265a8 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "radeon_compiler.h"
 
-void rc_remove_unused_constants(struct radeon_compiler *c,
-                                unsigned **out_remap_table);
+void rc_remove_unused_constants(struct radeon_compiler *c, void *user);
 
 #endif