From 072ea414d04f1b9a7bf06a00b9011e8ad521c878 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 1 Sep 2014 10:54:00 -0700 Subject: [PATCH] i965: Remove cfg-invalidating parameter from invalidate_live_intervals. Everything has been converted to preserve the CFG. Reviewed-by: Topi Pohjolainen --- .../dri/i965/brw_dead_control_flow.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs.cpp | 20 +++++++++---------- src/mesa/drivers/dri/i965/brw_fs.h | 2 +- .../dri/i965/brw_fs_copy_propagation.cpp | 2 +- src/mesa/drivers/dri/i965/brw_fs_cse.cpp | 2 +- .../dri/i965/brw_fs_dead_code_eliminate.cpp | 2 +- .../dri/i965/brw_fs_live_variables.cpp | 5 +---- .../i965/brw_fs_peephole_predicated_break.cpp | 2 +- .../drivers/dri/i965/brw_fs_reg_allocate.cpp | 2 +- .../dri/i965/brw_fs_register_coalesce.cpp | 2 +- .../dri/i965/brw_fs_saturate_propagation.cpp | 2 +- .../drivers/dri/i965/brw_fs_sel_peephole.cpp | 2 +- .../dri/i965/brw_schedule_instructions.cpp | 4 ++-- src/mesa/drivers/dri/i965/brw_shader.h | 2 +- src/mesa/drivers/dri/i965/brw_vec4.cpp | 10 +++++----- src/mesa/drivers/dri/i965/brw_vec4.h | 2 +- .../dri/i965/brw_vec4_copy_propagation.cpp | 2 +- src/mesa/drivers/dri/i965/brw_vec4_cse.cpp | 2 +- .../dri/i965/brw_vec4_live_variables.cpp | 5 +---- .../dri/i965/brw_vec4_reg_allocate.cpp | 2 +- 20 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp index 7a302da1b6b..9d5ba58ba21 100644 --- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp +++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp @@ -124,7 +124,7 @@ dead_control_flow_eliminate(backend_visitor *v) } if (progress) - v->invalidate_live_intervals(false); + v->invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 9b028782266..0010c17c579 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -1721,7 +1721,7 @@ fs_visitor::split_virtual_grfs() } } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } /** @@ -1759,7 +1759,7 @@ fs_visitor::compact_virtual_grfs() if (remap_table[i] != -1) { remap_table[i] = new_index; virtual_grf_sizes[new_index] = virtual_grf_sizes[i]; - invalidate_live_intervals(false); + invalidate_live_intervals(); ++new_index; } } @@ -1993,7 +1993,7 @@ fs_visitor::demote_pull_constants() inst->src[i].reg_offset = 0; } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } bool @@ -2154,7 +2154,7 @@ fs_visitor::opt_register_renaming() } if (progress) { - invalidate_live_intervals(false); + invalidate_live_intervals(); for (unsigned i = 0; i < ARRAY_SIZE(delta_x); i++) { if (delta_x[i].file == GRF && remap[delta_x[i].reg] != -1) { @@ -2328,7 +2328,7 @@ fs_visitor::compute_to_mrf() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -2498,7 +2498,7 @@ fs_visitor::remove_duplicate_mrf_writes() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -2715,7 +2715,7 @@ fs_visitor::insert_gen4_send_dependency_workarounds() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); } /** @@ -2773,7 +2773,7 @@ fs_visitor::lower_uniform_pull_constant_loads() inst->opcode = FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7; inst->src[1] = payload; - invalidate_live_intervals(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 @@ -2814,7 +2814,7 @@ fs_visitor::lower_load_payload() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -3164,7 +3164,7 @@ fs_visitor::assign_binding_table_offsets() void fs_visitor::calculate_register_pressure() { - invalidate_live_intervals(false); + invalidate_live_intervals(); calculate_live_intervals(); unsigned num_instructions = instructions.length(); diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 670000361c1..f8bc46c710a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -329,7 +329,7 @@ public: void move_uniform_array_access_to_pull_constants(); void assign_constant_locations(); void demote_pull_constants(); - void invalidate_live_intervals(bool invalidate_cfg = true); + void invalidate_live_intervals(); void calculate_live_intervals(); void calculate_register_pressure(); bool opt_algebraic(); 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 e5816df7e1b..806135b1163 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -649,7 +649,7 @@ fs_visitor::opt_copy_propagate() ralloc_free(copy_prop_ctx); if (progress) - invalidate_live_intervals(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 9db6865f589..5615b13495f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp @@ -321,7 +321,7 @@ fs_visitor::opt_cse() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp index 697b44ada0f..3cb63399d3e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp @@ -106,7 +106,7 @@ fs_visitor::dead_code_eliminate() } } - invalidate_live_intervals(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 e7ecb0fefda..577f4dbeb49 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp @@ -290,13 +290,10 @@ fs_live_variables::~fs_live_variables() } void -fs_visitor::invalidate_live_intervals(bool __invalidate_cfg) +fs_visitor::invalidate_live_intervals() { ralloc_free(live_intervals); live_intervals = NULL; - - if (__invalidate_cfg) - invalidate_cfg(); } /** diff --git a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp index eb9968179f2..a1bc14d347e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp @@ -110,7 +110,7 @@ fs_visitor::opt_peephole_predicated_break() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } 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 237cc497433..53cfa63637c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp @@ -728,5 +728,5 @@ fs_visitor::spill_reg(int spill_reg) } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } 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 c1b785b1ed2..b4abb4caa7e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp @@ -280,7 +280,7 @@ fs_visitor::register_coalesce() } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } return progress; diff --git a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp index 3412ce0a284..d65b2f14e13 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp @@ -100,7 +100,7 @@ fs_visitor::opt_saturate_propagation() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp index f6091387530..0bc734e1a15 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp @@ -231,7 +231,7 @@ fs_visitor::opt_peephole_sel() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp index bac0d556e15..e1806b973f2 100644 --- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp +++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp @@ -1511,7 +1511,7 @@ fs_visitor::schedule_instructions(instruction_scheduler_mode mode) dispatch_width, sched.time); } - invalidate_live_intervals(false); + invalidate_live_intervals(); } void @@ -1524,5 +1524,5 @@ vec4_visitor::opt_schedule_instructions() fprintf(stderr, "vec4 estimated execution time: %d cycles\n", sched.time); } - invalidate_live_intervals(false); + invalidate_live_intervals(); } diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h index 342cdb3d635..35a2b9635a3 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.h +++ b/src/mesa/drivers/dri/i965/brw_shader.h @@ -182,7 +182,7 @@ public: void assign_common_binding_table_offsets(uint32_t next_binding_table_offset); - virtual void invalidate_live_intervals(bool invalidate_cfg = true) = 0; + virtual void invalidate_live_intervals() = 0; }; uint32_t brw_texture_offset(struct gl_context *ctx, ir_constant *offset); diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index b434a7b5af2..d1a3d48f9c4 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -406,7 +406,7 @@ vec4_visitor::opt_reduce_swizzle() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -563,7 +563,7 @@ vec4_visitor::dead_code_eliminate() } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } return progress; @@ -742,7 +742,7 @@ vec4_visitor::opt_algebraic() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -1195,7 +1195,7 @@ vec4_visitor::opt_register_coalesce() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } @@ -1274,7 +1274,7 @@ vec4_visitor::split_virtual_grfs() } } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } void diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 9092f1c8a95..750f4911592 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -383,7 +383,7 @@ public: void split_uniform_registers(); void pack_uniform_registers(); void calculate_live_intervals(); - void invalidate_live_intervals(bool invalidate_cfg = true); + void invalidate_live_intervals(); void split_virtual_grfs(); bool opt_reduce_swizzle(); bool dead_code_eliminate(); diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp index 67693106fa3..fe47b0f6e0b 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp @@ -438,7 +438,7 @@ vec4_visitor::opt_copy_propagation() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp index a9265530d17..a7cabc8a210 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp @@ -260,7 +260,7 @@ vec4_visitor::opt_cse() } if (progress) - invalidate_live_intervals(false); + invalidate_live_intervals(); return progress; } diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp index 7cd1dd65bd3..268617401d5 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp @@ -268,12 +268,9 @@ vec4_visitor::calculate_live_intervals() } void -vec4_visitor::invalidate_live_intervals(bool __invalidate_cfg) +vec4_visitor::invalidate_live_intervals() { live_intervals_valid = false; - - if (__invalidate_cfg) - invalidate_cfg(); } bool diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp index 15779b7908b..1ebebe0a891 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -354,7 +354,7 @@ vec4_visitor::spill_reg(int spill_reg_nr) } } - invalidate_live_intervals(false); + invalidate_live_intervals(); } } /* namespace brw */ -- 2.30.2