Mesa (main): r300: Remove some dead compiler code.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 16 17:06:31 UTC 2021


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

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Dec  8 11:45:22 2021 -0800

r300: Remove some dead compiler code.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14211>

---

 .../drivers/r300/compiler/radeon_compiler.c        | 57 ----------------------
 .../drivers/r300/compiler/radeon_compiler.h        |  2 -
 2 files changed, 59 deletions(-)

diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.c b/src/gallium/drivers/r300/compiler/radeon_compiler.c
index 85bdab1d97f..805d9a09617 100644
--- a/src/gallium/drivers/r300/compiler/radeon_compiler.c
+++ b/src/gallium/drivers/r300/compiler/radeon_compiler.c
@@ -135,63 +135,6 @@ void rc_calculate_inputs_outputs(struct radeon_compiler * c)
 	}
 }
 
-/**
- * Rewrite the program such that everything that source the given input
- * register will source new_input instead.
- */
-void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input)
-{
-	struct rc_instruction * inst;
-
-	c->Program.InputsRead &= ~(1U << input);
-
-	for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) {
-		const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode);
-		unsigned i;
-
-		for(i = 0; i < opcode->NumSrcRegs; ++i) {
-			if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT && inst->U.I.SrcReg[i].Index == input) {
-				inst->U.I.SrcReg[i].File = new_input.File;
-				inst->U.I.SrcReg[i].Index = new_input.Index;
-				inst->U.I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->U.I.SrcReg[i].Swizzle);
-				if (!inst->U.I.SrcReg[i].Abs) {
-					inst->U.I.SrcReg[i].Negate ^= new_input.Negate;
-					inst->U.I.SrcReg[i].Abs = new_input.Abs;
-				}
-
-				c->Program.InputsRead |= 1U << new_input.Index;
-			}
-		}
-	}
-}
-
-
-/**
- * Rewrite the program such that everything that writes into the given
- * output register will instead write to new_output. The new_output
- * writemask is honoured.
- */
-void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_output, unsigned writemask)
-{
-	struct rc_instruction * inst;
-
-	c->Program.OutputsWritten &= ~(1U << output);
-
-	for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) {
-		const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode);
-
-		if (opcode->HasDstReg) {
-			if (inst->U.I.DstReg.File == RC_FILE_OUTPUT && inst->U.I.DstReg.Index == output) {
-				inst->U.I.DstReg.Index = new_output;
-				inst->U.I.DstReg.WriteMask &= writemask;
-
-				c->Program.OutputsWritten |= 1U << new_output;
-			}
-		}
-	}
-}
-
-
 /**
  * Rewrite the program such that a given output is duplicated.
  */
diff --git a/src/gallium/drivers/r300/compiler/radeon_compiler.h b/src/gallium/drivers/r300/compiler/radeon_compiler.h
index e33872482ea..f9976d2e0c9 100644
--- a/src/gallium/drivers/r300/compiler/radeon_compiler.h
+++ b/src/gallium/drivers/r300/compiler/radeon_compiler.h
@@ -99,8 +99,6 @@ int rc_if_fail_helper(struct radeon_compiler * c, const char * file, int line, c
 
 void rc_calculate_inputs_outputs(struct radeon_compiler * c);
 
-void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input);
-void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_output, unsigned writemask);
 void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_output);
 void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsigned new_input,
                                 int full_vtransform);



More information about the mesa-commit mailing list