i965/fs: Relax type check in cmod propagation.
authorMatt Turner <mattst88@gmail.com>
Thu, 26 Mar 2015 17:09:54 +0000 (10:09 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 1 Apr 2015 20:43:57 +0000 (13:43 -0700)
The thing we want to avoid is int/float comparisons, but int/unsigned
comparisons with 0 are equivalent.

total instructions in shared programs: 6194829 -> 6193996 (-0.01%)
instructions in affected programs:     117192 -> 116359 (-0.71%)
helped:                                471

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp

index 798fef3035bf915ff23ff10877e15334da168097..469f2ea4e16e275da21748b4e85669ec3ae681c7 100644 (file)
@@ -111,7 +111,9 @@ opt_cmod_propagation_local(bblock_t *block)
                break;
 
             /* Comparisons operate differently for ints and floats */
-            if (scan_inst->dst.type != inst->dst.type)
+            if (scan_inst->dst.type != inst->dst.type &&
+                (scan_inst->dst.type == BRW_REGISTER_TYPE_F ||
+                 inst->dst.type == BRW_REGISTER_TYPE_F))
                break;
 
             /* If the instruction generating inst's source also wrote the