summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-08-06 02:17:24 -0700
committerEric Anholt <eric@anholt.net>2013-10-10 15:54:15 -0700
commit4b821a97b5fcdc4c530d5455c43196be09830322 (patch)
tree888ba829138508d624ac04b52ee030c1b76461a7
parent45ffaeccaf412f322605a7c7488c6ab0d85fc4b6 (diff)
i965/fs: Create a helper function for invalidating live intervals.
For now, this simply sets live_intervals_valid = false, but in the future it will do something more sophisticated. Based on a patch by Eric Anholt. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp21
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_cse.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp6
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp2
7 files changed, 21 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 02383363d4..d1aed42966 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1443,7 +1443,7 @@ fs_visitor::split_virtual_grfs()
}
}
}
- this->live_intervals_valid = false;
+ invalidate_live_intervals();
}
/**
@@ -1868,7 +1868,7 @@ fs_visitor::dead_code_eliminate()
}
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
@@ -2026,7 +2026,7 @@ fs_visitor::dead_code_eliminate_local()
_mesa_hash_table_destroy(ht, NULL);
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
@@ -2085,9 +2085,8 @@ fs_visitor::register_coalesce_2()
inst->remove();
/* We don't need to recalculate live intervals inside the loop despite
- * flagging live_intervals_valid because we only use live intervals for
- * the interferes test, and we must have had a situation where the
- * intervals were:
+ * invalidating them; we only use them for the interferes test, and we
+ * must have had a situation where the intervals were:
*
* from to
* ^
@@ -2103,7 +2102,7 @@ fs_visitor::register_coalesce_2()
* otherwise it will conflict with "to" when we try to coalesce "to"
* into Rw anyway.
*/
- live_intervals_valid = false;
+ invalidate_live_intervals();
progress = true;
continue;
@@ -2244,7 +2243,7 @@ fs_visitor::register_coalesce()
}
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
@@ -2407,7 +2406,7 @@ fs_visitor::compute_to_mrf()
}
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
@@ -2478,7 +2477,7 @@ fs_visitor::remove_duplicate_mrf_writes()
}
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
@@ -2745,7 +2744,7 @@ fs_visitor::lower_uniform_pull_constant_loads()
inst->opcode = FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7;
inst->src[1] = payload;
- this->live_intervals_valid = false;
+ invalidate_live_intervals();
} else {
/* Before register allocation, we didn't tell the scheduler about the
* MRF we use. We know it's safe to use this MRF because nothing
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 5c7089daff..c8f10c39ea 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -290,6 +290,7 @@ public:
void compact_virtual_grfs();
void move_uniform_array_access_to_pull_constants();
void setup_pull_constants();
+ void invalidate_live_intervals();
void calculate_live_intervals();
bool opt_algebraic();
bool opt_cse();
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 5acef207af..fb6fe184f3 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -562,7 +562,7 @@ fs_visitor::opt_copy_propagate()
ralloc_free(mem_ctx);
if (progress)
- live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index 61b3aeb5ac..d8ed4be7b0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -209,7 +209,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
ralloc_free(mem_ctx);
if (progress)
- this->live_intervals_valid = false;
+ invalidate_live_intervals();
return progress;
}
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
index 4e9825f1e7..099eeaa0bb 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -197,6 +197,12 @@ fs_live_variables::~fs_live_variables()
#define MAX_INSTRUCTION (1 << 30)
+void
+fs_visitor::invalidate_live_intervals()
+{
+ this->live_intervals_valid = false;
+}
+
/**
* Compute the live intervals for each virtual GRF.
*
diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index b9102d97e1..68501021ee 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -658,5 +658,5 @@ fs_visitor::spill_reg(int spill_reg)
}
}
- this->live_intervals_valid = false;
+ invalidate_live_intervals();
}
diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
index 5530683df8..735ad93561 100644
--- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
+++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
@@ -1138,7 +1138,7 @@ fs_visitor::schedule_instructions(bool post_reg_alloc)
dispatch_width, sched.time);
}
- this->live_intervals_valid = false;
+ invalidate_live_intervals();
}
void