Commit 92dc16c3 authored by Matt Turner's avatar Matt Turner

i965: Don't dead-code eliminate instructions that write to the accumulator.

Reviewed-by: default avatarPaul Berry <stereotype441@gmail.com>
Reviewed-by: default avatarKenneth Graunke <kenneth@whitecape.org>
parent 014cce3d
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment