summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-14 23:02:42 -0500
committerJason Ekstrand <[email protected]>2019-05-16 02:13:09 +0000
commit2c14e2b5bfcef69ac173d3d512edf5d017f0be64 (patch)
tree538b98c4429a452960ce467a1dc08a70ec6adf24 /src/intel
parent46494c3dc140d99391cf3b6f69c514489fab4784 (diff)
intel/fs/ra: Add a helper for discarding the interference graph
Tested-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/compiler/brw_fs_reg_allocate.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp
index b2bd514dc3b..aeb7214ba38 100644
--- a/src/intel/compiler/brw_fs_reg_allocate.cpp
+++ b/src/intel/compiler/brw_fs_reg_allocate.cpp
@@ -431,6 +431,7 @@ private:
void setup_inst_interference(fs_inst *inst);
void build_interference_graph(bool allow_spilling);
+ void discard_interference_graph();
void set_spill_costs();
int choose_spill_reg();
@@ -800,6 +801,13 @@ fs_reg_alloc::build_interference_graph(bool allow_spilling)
set_spill_costs();
}
+void
+fs_reg_alloc::discard_interference_graph()
+{
+ ralloc_free(g);
+ g = NULL;
+}
+
static void
emit_unspill(const fs_builder &bld, fs_reg dst,
uint32_t spill_offset, unsigned count)
@@ -1148,8 +1156,7 @@ fs_reg_alloc::assign_regs(bool allow_spilling, bool spill_all)
* re-build the interference graph with MRFs enabled to allow spilling.
*/
if (!fs->spilled_any_registers) {
- ralloc_free(g);
- g = NULL;
+ discard_interference_graph();
build_interference_graph(true);
}