summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-04-15 16:28:04 -0700
committerMatt Turner <[email protected]>2014-04-18 09:16:19 -0700
commitef6127ff690031e0eec9eb9ee959cede542ad244 (patch)
treeda17acf75bbad37d84ecedf2d638580e68a3cac8 /src
parent352e06ddea1108bad1d2c6742fe3a67b2b1da5d9 (diff)
i965/fs: Only sweep NOPs if register coalescing made progress.
Otherwise there's nothing to do. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp16
1 files changed, 9 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 4e3b611197a..f6d9b680b22 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -170,6 +170,8 @@ fs_visitor::register_coalesce()
if (!can_coalesce)
continue;
+ progress = true;
+
for (int i = 0; i < src_size; i++) {
if (mov[i]) {
mov[i]->opcode = BRW_OPCODE_NOP;
@@ -215,17 +217,17 @@ 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();
+ }
}
- }
- if (progress)
invalidate_live_intervals();
+ }
return progress;
}