diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-09-02 10:21:23 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-09-04 18:56:22 +0200 |
commit | aa554d508b03ee54f2553200d0d43c78b3982e44 (patch) | |
tree | ac75cd8ef76cbe3b5bfdeb8a599e9027d3384f44 /src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c | |
parent | f90c870304ad7222779c3e3bed0e2bbd4214d0cf (diff) |
r300/compiler: disable deadcode elimination for indexed dst operands
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c index 701092b625..9d17b4772a 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -220,6 +220,18 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) unsigned has_temp_reladdr_src = 0; rc_dataflow_mark_outputs_fn dce = (rc_dataflow_mark_outputs_fn)user; + /* Give up if there is relative addressing of destination operands. */ + for(struct rc_instruction * 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 && + inst->U.I.DstReg.WriteMask && + inst->U.I.DstReg.RelAddr) { + return; + } + } + memset(&s, 0, sizeof(s)); s.C = c; @@ -316,6 +328,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) for (struct rc_instruction *ptr = inst->Prev; ptr != &c->Program.Instructions; ptr = ptr->Prev) { + opcode = rc_get_opcode_info(ptr->U.I.Opcode); if (opcode->HasDstReg && ptr->U.I.DstReg.File == RC_FILE_TEMPORARY && ptr->U.I.DstReg.WriteMask) { @@ -327,6 +340,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, void *user) } has_temp_reladdr_src = 1; + break; } } } |