i965/fs: Use overwrites_reg() instead of dst.equals().
authorMatt Turner <mattst88@gmail.com>
Wed, 19 Aug 2015 00:10:44 +0000 (17:10 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 28 Aug 2015 18:30:47 +0000 (11:30 -0700)
equals() returns false for registers with different types, using it
isn't appropriate to determine whether an is overwriting a register.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp

index 72e873857ced950272a885b15db2914b50ba3e2c..218cc614e6d88e86684b9e6c88e8cfac3883c3f4 100644 (file)
@@ -128,8 +128,8 @@ can_coalesce_vars(brw::fs_live_variables *live_intervals,
       if (scan_ip > live_intervals->end[var_to])
          return true;
 
-      if (scan_inst->dst.equals(inst->dst) ||
-          scan_inst->dst.equals(inst->src[0]))
+      if (scan_inst->overwrites_reg(inst->dst) ||
+          scan_inst->overwrites_reg(inst->src[0]))
          return false;
    }