mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
i965: Don't dead-code eliminate instructions that write to the accumulator.
Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
014cce3dc4
commit
92dc16c3e2
2 changed files with 30 additions and 2 deletions
|
|
@ -1846,7 +1846,21 @@ fs_visitor::dead_code_eliminate()
|
|||
if (inst->dst.file == GRF) {
|
||||
assert(this->virtual_grf_end[inst->dst.reg] >= pc);
|
||||
if (this->virtual_grf_end[inst->dst.reg] == pc) {
|
||||
inst->remove();
|
||||
/* Don't dead code eliminate instructions that write to the
|
||||
* accumulator as a side-effect. Instead just set the destination
|
||||
* to the null register to free it.
|
||||
*/
|
||||
switch (inst->opcode) {
|
||||
case BRW_OPCODE_ADDC:
|
||||
case BRW_OPCODE_SUBB:
|
||||
case BRW_OPCODE_MACH:
|
||||
inst->dst.file = ARF;
|
||||
inst->dst.reg = BRW_ARF_NULL;
|
||||
break;
|
||||
default:
|
||||
inst->remove();
|
||||
break;
|
||||
}
|
||||
progress = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,7 +314,21 @@ vec4_visitor::dead_code_eliminate()
|
|||
if (inst->dst.file == GRF) {
|
||||
assert(this->virtual_grf_end[inst->dst.reg] >= pc);
|
||||
if (this->virtual_grf_end[inst->dst.reg] == pc) {
|
||||
inst->remove();
|
||||
/* Don't dead code eliminate instructions that write to the
|
||||
* accumulator as a side-effect. Instead just set the destination
|
||||
* to the null register to free it.
|
||||
*/
|
||||
switch (inst->opcode) {
|
||||
case BRW_OPCODE_ADDC:
|
||||
case BRW_OPCODE_SUBB:
|
||||
case BRW_OPCODE_MACH:
|
||||
inst->dst.file = ARF;
|
||||
inst->dst.reg = BRW_ARF_NULL;
|
||||
break;
|
||||
default:
|
||||
inst->remove();
|
||||
break;
|
||||
}
|
||||
progress = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue