<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 15, 2019 at 7:54 AM Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">NIR already has these so they are redundant. A run of shader-db confirms<br>
that the only cases where these backend optimizations are activated<br>
are some Tomb Raider shaders where the affected variables are qualified<br>
as "precise", which is why NIR won't apply them and why the backend<br>
shouldn't either (so it is actually a bug).<br>
<br>
Suggested-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
---<br>
 src/intel/compiler/brw_fs.cpp | 37 -----------------------------------<br>
 1 file changed, 37 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp<br>
index 77c955ac435..e7f5a8822a3 100644<br>
--- a/src/intel/compiler/brw_fs.cpp<br>
+++ b/src/intel/compiler/brw_fs.cpp<br>
@@ -2568,16 +2568,6 @@ fs_visitor::opt_algebraic()<br>
             break;<br>
          }<br>
          break;<br>
-      case BRW_OPCODE_LRP:<br>
-         if (inst->src[1].equals(inst->src[2])) {<br>
-            inst->opcode = BRW_OPCODE_MOV;<br>
-            inst->src[0] = inst->src[1];<br>
-            inst->src[1] = reg_undef;<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-            break;<br>
-         }<br>
-         break;<br>
       case BRW_OPCODE_CMP:<br>
          if ((inst->conditional_mod == BRW_CONDITIONAL_Z ||<br>
               inst->conditional_mod == BRW_CONDITIONAL_NZ) &&<br>
@@ -2654,33 +2644,6 @@ fs_visitor::opt_algebraic()<br>
             }<br>
          }<br>
          break;<br>
-      case BRW_OPCODE_MAD:<br>
-         if (inst->src[1].is_zero() || inst->src[2].is_zero()) {<br>
-            inst->opcode = BRW_OPCODE_MOV;<br>
-            inst->src[1] = reg_undef;<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-         } else if (inst->src[0].is_zero()) {<br>
-            inst->opcode = BRW_OPCODE_MUL;<br>
-            inst->src[0] = inst->src[2];<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-         } else if (inst->src[1].is_one()) {<br>
-            inst->opcode = BRW_OPCODE_ADD;<br>
-            inst->src[1] = inst->src[2];<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-         } else if (inst->src[2].is_one()) {<br>
-            inst->opcode = BRW_OPCODE_ADD;<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-         } else if (inst->src[1].file == IMM && inst->src[2].file == IMM) {<br>
-            inst->opcode = BRW_OPCODE_ADD;<br>
-            inst->src[1].f *= inst->src[2].f;<br>
-            inst->src[2] = reg_undef;<br>
-            progress = true;<br>
-         }<br>
-         break;<br>
       case SHADER_OPCODE_BROADCAST:<br>
          if (is_uniform(inst->src[0])) {<br>
             inst->opcode = BRW_OPCODE_MOV;<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>