[Mesa-dev] [PATCH 1/9] i965/fs: Remove the RCP+RSQ peephole

Jason Ekstrand jason at jlekstrand.net
Thu Mar 17 17:21:38 UTC 2016


NIR already has this optimization and it can do much better than the little
peephole in the backend.

No shader-db change on Broadwell.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 86d2bd9..ba6ae59 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()
             progress = true;
          }
          break;
-      case SHADER_OPCODE_RCP: {
-         fs_inst *prev = (fs_inst *)inst->prev;
-         if (prev->opcode == SHADER_OPCODE_SQRT) {
-            if (inst->src[0].equals(prev->dst)) {
-               inst->opcode = SHADER_OPCODE_RSQ;
-               inst->src[0] = prev->src[0];
-               progress = true;
-            }
-         }
-         break;
-      }
       case SHADER_OPCODE_BROADCAST:
          if (is_uniform(inst->src[0])) {
             inst->opcode = BRW_OPCODE_MOV;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list