i965/fs: Let register_coalesce_2() eliminate self-moves.
authorMatt Turner <mattst88@gmail.com>
Fri, 29 Nov 2013 19:28:54 +0000 (11:28 -0800)
committerMatt Turner <mattst88@gmail.com>
Thu, 5 Dec 2013 04:05:42 +0000 (20:05 -0800)
This is the last thing that register_coalesce() still handled.

total instructions in shared programs: 1561060 -> 1560908 (-0.01%)
instructions in affected programs:     15758 -> 15606 (-0.96%)

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs.cpp

index eecde6271d9c0221fadba916d5f5969947983df4..168411cc14d3b54b560e552c8ef4c653e8f1b25a 100644 (file)
@@ -2271,7 +2271,8 @@ fs_visitor::register_coalesce_2()
       int var_from = live_intervals->var_from_reg(&inst->src[0]);
       int var_to = live_intervals->var_from_reg(&inst->dst);
 
-      if (live_intervals->vars_interfere(var_from, var_to))
+      if (live_intervals->vars_interfere(var_from, var_to) &&
+          !inst->dst.equals(inst->src[0]))
          continue;
 
       int reg_from = inst->src[0].reg;