From a8f76d829bdcdb5f238ba6206f1b768098745022 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sun, 27 Oct 2013 19:34:48 -0700 Subject: [PATCH] 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 --- src/mesa/drivers/dri/i965/brw_fs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.30.2