We were special casing OPCODE_END but no other instructions that have no
destination, like OPCODE_KIL, leading us to emitting MOVs with null
destinations.
total instructions in shared programs:
5705243 ->
5701539 (-0.06%)
instructions in affected programs: 124104 -> 120400 (-2.98%)
helped: 904
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/* To handle saturates, we emit a MOV with a saturate bit, which
* optimization should fold into the preceding instructions when safe.
*/
- if (fpi->Opcode != OPCODE_END) {
+ if (_mesa_num_inst_dst_regs(fpi->Opcode) != 0) {
fs_reg real_dst = get_fp_dst_reg(&fpi->DstReg);
for (int i = 0; i < 4; i++) {
}
/* Copy the temporary back into the actual destination register. */
- if (vpi->Opcode != OPCODE_END) {
+ if (_mesa_num_inst_dst_regs(vpi->Opcode) != 0) {
emit(MOV(get_vp_dst_reg(vpi->DstReg), src_reg(dst)));
}
}