From 1520ae48b880d9bee287583d15ac40c89d0ced8b Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 29 Nov 2013 11:28:54 -0800 Subject: [PATCH] i965/fs: Let register_coalesce_2() eliminate self-moves. 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 --- 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 eecde6271d9..168411cc14d 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; -- 2.30.2