[Mesa-dev] [PATCH 11/15] i965/fs: Let register_coalesce_2() eliminate self-moves.

Matt Turner mattst88 at gmail.com
Mon Dec 2 10:40:33 PST 2013


This is the last thing that register_coalesce() still handled.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index eecde62..168411c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -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;
-- 
1.8.3.2



More information about the mesa-dev mailing list