* to loop over all the virtual GRFs. Compacting them can save a lot of
* overhead.
*/
-void
+bool
fs_visitor::compact_virtual_grfs()
{
- if (unlikely(INTEL_DEBUG & DEBUG_OPTIMIZER))
- return;
-
+ bool progress = false;
int remap_table[this->virtual_grf_count];
memset(remap_table, -1, sizeof(remap_table));
/* Compact the GRF arrays. */
int new_index = 0;
for (int i = 0; i < this->virtual_grf_count; i++) {
- if (remap_table[i] != -1) {
+ if (remap_table[i] == -1) {
+ /* We just found an unused register. This means that we are
+ * actually going to compact something.
+ */
+ progress = true;
+ } else {
remap_table[i] = new_index;
virtual_grf_sizes[new_index] = virtual_grf_sizes[i];
invalidate_live_intervals();
}
}
}
+
+ return progress;
}
/*
iteration++;
int pass_num = 0;
- compact_virtual_grfs();
-
OPT(remove_duplicate_mrf_writes);
OPT(opt_algebraic);
OPT(opt_saturate_propagation);
OPT(register_coalesce);
OPT(compute_to_mrf);
+
+ OPT(compact_virtual_grfs);
} while (progress);
if (lower_load_payload()) {
int choose_spill_reg(struct ra_graph *g);
void spill_reg(int spill_reg);
void split_virtual_grfs();
- void compact_virtual_grfs();
+ bool compact_virtual_grfs();
void move_uniform_array_access_to_pull_constants();
void assign_constant_locations();
void demote_pull_constants();