i965/fs: Optimize LRP with x == y into a MOV.

total instructions in shared programs: 1487331 -> 1485988 (-0.09%)
instructions in affected programs:     45638 -> 44295 (-2.94%)
GAINED:                                7
LOST:                                  0

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Matt Turner 2014-01-09 20:57:36 -08:00
parent 8d37e9915a
commit bf0773aeca

View file

@ -2000,6 +2000,16 @@ fs_visitor::opt_algebraic()
break;
}
break;
case BRW_OPCODE_LRP:
if (inst->src[1].equals(inst->src[2])) {
inst->opcode = BRW_OPCODE_MOV;
inst->src[0] = inst->src[1];
inst->src[1] = reg_undef;
inst->src[2] = reg_undef;
progress = true;
break;
}
break;
case BRW_OPCODE_SEL:
if (inst->saturate && inst->src[1].file == IMM) {
switch (inst->conditional_mod) {