r300: get rid of the register rename pass

The pass tried to convert shaders to a SSA-like form. However since
we no longer allocate registers in NIR, and we try hard to keep the
SSA-like form during the later passes, this is now superfluous.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33066>
This commit is contained in:
Pavel Ondračka 2024-12-10 09:00:03 +01:00 committed by Marge Bot
parent c45f02461c
commit 47207dcb0b
4 changed files with 0 additions and 73 deletions

View file

@ -16,7 +16,6 @@
#include "radeon_program_alu.h"
#include "radeon_program_tex.h"
#include "radeon_remove_constants.h"
#include "radeon_rename_regs.h"
#include "radeon_variable.h"
static void
@ -175,7 +174,6 @@ r3xx_compile_fragment_program(struct r300_fragment_program_compiler *c)
{"native rewrite", 1, !is_r500, rc_local_transform, native_rewrite_r300},
{"deadcode", 1, opt, rc_dataflow_deadcode, NULL},
{"convert rgb<->alpha", 1, opt, rc_convert_rgb_alpha, NULL},
{"register rename", 1, !is_r500 || opt, rc_rename_regs, NULL},
{"dataflow optimize", 1, opt, rc_optimize, NULL},
{"inline literals", 1, is_r500 && opt, rc_inline_literals, NULL},
{"dataflow swizzles", 1, 1, rc_dataflow_swizzles, NULL},

View file

@ -1,56 +0,0 @@
/*
* Copyright 2010 Tom Stellard <tstellar@gmail.com>
* SPDX-License-Identifier: MIT
*/
#include "util/u_math.h"
#include "radeon_rename_regs.h"
#include "radeon_compiler.h"
#include "radeon_list.h"
#include "radeon_program.h"
#include "radeon_variable.h"
/**
* This function renames registers in an attempt to get the code close to
* SSA form. After this function has completed, most of the register are only
* written to one time, with a few exceptions.
*
* This function assumes all the instructions are still of type
* RC_INSTRUCTION_NORMAL.
*/
void
rc_rename_regs(struct radeon_compiler *c, void *user)
{
struct rc_instruction *inst;
struct rc_list *variables;
struct rc_list *var_ptr;
/* XXX Remove this once the register allocation works with flow control. */
for (inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) {
if (inst->U.I.Opcode == RC_OPCODE_BGNLOOP)
return;
}
variables = rc_get_variables(c);
for (var_ptr = variables; var_ptr; var_ptr = var_ptr->Next) {
int new_index;
unsigned writemask;
struct rc_variable *var = var_ptr->Item;
if (var->Inst->U.I.DstReg.File != RC_FILE_TEMPORARY) {
continue;
}
new_index = rc_find_free_temporary(c);
if (new_index < 0) {
rc_error(c, "Ran out of temporary registers\n");
return;
}
writemask = rc_variable_writemask_sum(var);
rc_variable_change_dst(var, new_index, writemask);
}
}

View file

@ -1,13 +0,0 @@
/*
* Copyright 2010 Tom Stellard <tstellar@gmail.com>
* SPDX-License-Identifier: MIT
*/
#ifndef RADEON_RENAME_REGS_H
#define RADEON_RENAME_REGS_H
struct radeon_compiler;
void rc_rename_regs(struct radeon_compiler *c, void *user);
#endif /* RADEON_RENAME_REGS_H */

View file

@ -95,8 +95,6 @@ files_r300 = files(
'compiler/radeon_regalloc.h',
'compiler/radeon_remove_constants.c',
'compiler/radeon_remove_constants.h',
'compiler/radeon_rename_regs.c',
'compiler/radeon_rename_regs.h',
'compiler/radeon_swizzle.h',
'compiler/radeon_variable.c',
'compiler/radeon_variable.h',