From: Matt Turner Date: Mon, 28 Oct 2013 02:34:48 +0000 (-0700) Subject: i965/fs: Optimize OR with identical sources into a MOV. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8f76d829bdcdb5f238ba6206f1b768098745022;p=mesa.git 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 Reviewed-by: Paul Berry --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 236e86c7cc2..2350cd097c5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -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; }