Mesa (master): i965/fs: Only sweep NOPs if register coalescing made progress.

Matt Turner mattst88 at kemper.freedesktop.org
Wed Apr 16 00:27:30 UTC 2014


Module: Mesa
Branch: master
Commit: f092e8951ce5212ba3cbb382ce3a6666eb6c9bed
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f092e8951ce5212ba3cbb382ce3a6666eb6c9bed

Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Apr 15 16:28:04 2014 -0700

i965/fs: Only sweep NOPs if register coalescing made progress.

Otherwise there's nothing to do.

---

 src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
index 4e3b611..d5dd2c2 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -215,17 +215,18 @@ fs_visitor::register_coalesce()
       reg_from = -1;
    }
 
-   foreach_list_safe(node, &this->instructions) {
-      fs_inst *inst = (fs_inst *)node;
+   if (progress) {
+      foreach_list_safe(node, &this->instructions) {
+         fs_inst *inst = (fs_inst *)node;
 
-      if (inst->opcode == BRW_OPCODE_NOP) {
-         inst->remove();
-         progress = true;
+         if (inst->opcode == BRW_OPCODE_NOP) {
+            inst->remove();
+            progress = true;
+         }
       }
-   }
 
-   if (progress)
       invalidate_live_intervals();
+   }
 
    return progress;
 }




More information about the mesa-commit mailing list