intel/compiler: Remove unnecessary optimization for MUL
authorSagar Ghuge <sagar.ghuge@intel.com>
Mon, 8 Jun 2020 22:35:29 +0000 (15:35 -0700)
committerSagar Ghuge <sagar.ghuge@intel.com>
Wed, 17 Jun 2020 00:11:32 +0000 (17:11 -0700)
2 source instruction only support immediate for src1 operand, so no
point in adding optimization condition for src0 oprand.

v2:
- Update commit message and don't remove ADD optimization (Matt Turner)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5341>

src/intel/compiler/brw_fs.cpp

index 1b0327e157ee2bcb58724f1abf4c2874d72f54bf..a41d15270b900b5d6777172d16754ec527ee8d85 100644 (file)
@@ -2698,14 +2698,6 @@ fs_visitor::opt_algebraic()
             break;
          }
 
-         if (inst->src[0].file == IMM) {
-            assert(inst->src[0].type == BRW_REGISTER_TYPE_F);
-            inst->opcode = BRW_OPCODE_MOV;
-            inst->src[0].f *= inst->src[1].f;
-            inst->src[1] = reg_undef;
-            progress = true;
-            break;
-         }
          break;
       case BRW_OPCODE_ADD:
          if (inst->src[1].file != IMM)