i965/fs: Only sweep NOPs if register coalescing made progress.
authorMatt Turner <mattst88@gmail.com>
Tue, 15 Apr 2014 23:28:04 +0000 (16:28 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 15 Apr 2014 23:28:04 +0000 (16:28 -0700)
Otherwise there's nothing to do.

src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp

index 4e3b611197ad823ff2f8c2c50f13f3f96458fb3a..d5dd2c2954e911dcfb4ce6f3fd1b0fa57cf686d2 100644 (file)
@@ -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;
 }