i965: Don't make instructions with a null dest a barrier to scheduling.
authorMatt Turner <mattst88@gmail.com>
Wed, 9 Apr 2014 20:38:14 +0000 (13:38 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 17 Apr 2014 05:46:45 +0000 (22:46 -0700)
Now that we properly track accumulator dependencies, the scheduler is
able to schedule instructions between the mach and mov in the common
the integer multiplication pattern:

   mul  acc0, x, y
   mach null, x, y
   mov  dest, acc0

Since a null destination implies no dependency on the destination, we
can also safely schedule instructions (that don't write the accumulator)
between the mul and mach.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp

index 5e4f2fe747879e1240907f3af41b2a5a1e89551e..8cc69088fe6fdc18402ad2f6c6691160ba1ee03b 100644 (file)
@@ -870,7 +870,8 @@ fs_instruction_scheduler::calculate_deps()
       } else if (inst->dst.is_accumulator() && gen6plus) {
          add_dep(last_accumulator_write, n);
          last_accumulator_write = n;
-      } else if (inst->dst.file != BAD_FILE) {
+      } else if (inst->dst.file != BAD_FILE &&
+                 !inst->dst.is_null()) {
         add_barrier_deps(n);
       }
 
@@ -997,7 +998,8 @@ fs_instruction_scheduler::calculate_deps()
          }
       } else if (inst->dst.is_accumulator() && gen6plus) {
          last_accumulator_write = n;
-      } else if (inst->dst.file != BAD_FILE) {
+      } else if (inst->dst.file != BAD_FILE &&
+                 !inst->dst.is_null()) {
         add_barrier_deps(n);
       }
 
@@ -1113,7 +1115,8 @@ vec4_instruction_scheduler::calculate_deps()
       } else if (inst->dst.is_accumulator() && gen6plus) {
          add_dep(last_accumulator_write, n);
          last_accumulator_write = n;
-      } else if (inst->dst.file != BAD_FILE) {
+      } else if (inst->dst.file != BAD_FILE &&
+                 !inst->dst.is_null()) {
          add_barrier_deps(n);
       }
 
@@ -1205,7 +1208,8 @@ vec4_instruction_scheduler::calculate_deps()
          last_fixed_grf_write = n;
       } else if (inst->dst.is_accumulator() && gen6plus) {
          last_accumulator_write = n;
-      } else if (inst->dst.file != BAD_FILE) {
+      } else if (inst->dst.file != BAD_FILE &&
+                 !inst->dst.is_null()) {
          add_barrier_deps(n);
       }