i965/fs: Optimize OR with identical sources into a MOV.

Helps a lot of Steam games.

total instructions in shared programs: 1409360 -> 1409124 (-0.02%)
instructions in affected programs:     20842 -> 20606 (-1.13%)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Matt Turner 2013-10-27 19:34:48 -07:00
parent fd05ede0d0
commit a8f76d829b

View file

@ -1872,6 +1872,14 @@ fs_visitor::opt_algebraic()
break;
}
break;
case BRW_OPCODE_OR:
if (inst->src[0].equals(inst->src[1])) {
inst->opcode = BRW_OPCODE_MOV;
inst->src[1] = reg_undef;
progress = true;
break;
}
break;
default:
break;
}