Quellcode durchsuchen

i965/fs: Pass cfg to calculate_live_intervals().

We've often created the CFG immediately before, so use it when
available.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
tags/10.3-branchpoint
Matt Turner vor 11 Jahren
Ursprung
Commit
2e90d1fb62

+ 1
- 1
src/mesa/drivers/dri/i965/brw_fs.h Datei anzeigen

@@ -373,7 +373,7 @@ public:
void assign_constant_locations();
void demote_pull_constants();
void invalidate_live_intervals();
void calculate_live_intervals();
void calculate_live_intervals(const cfg_t *cfg = NULL);
void calculate_register_pressure();
bool opt_algebraic();
bool opt_cse();

+ 1
- 2
src/mesa/drivers/dri/i965/brw_fs_cse.cpp Datei anzeigen

@@ -317,9 +317,8 @@ fs_visitor::opt_cse()
{
bool progress = false;

calculate_live_intervals();

cfg_t cfg(&instructions);
calculate_live_intervals(&cfg);

for (int b = 0; b < cfg.num_blocks; b++) {
bblock_t *block = cfg.blocks[b];

+ 1
- 1
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp Datei anzeigen

@@ -41,7 +41,7 @@ fs_visitor::dead_code_eliminate()

cfg_t cfg(&instructions);

calculate_live_intervals();
calculate_live_intervals(&cfg);

int num_vars = live_intervals->num_vars;
BITSET_WORD *live = ralloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars));

+ 8
- 4
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp Datei anzeigen

@@ -243,7 +243,7 @@ fs_live_variables::var_from_reg(fs_reg *reg)
return var_from_vgrf[reg->reg] + reg->reg_offset;
}

fs_live_variables::fs_live_variables(fs_visitor *v, cfg_t *cfg)
fs_live_variables::fs_live_variables(fs_visitor *v, const cfg_t *cfg)
: v(v), cfg(cfg)
{
mem_ctx = ralloc_context(NULL);
@@ -304,7 +304,7 @@ fs_visitor::invalidate_live_intervals()
* information about whole VGRFs.
*/
void
fs_visitor::calculate_live_intervals()
fs_visitor::calculate_live_intervals(const cfg_t *cfg)
{
if (this->live_intervals)
return;
@@ -320,8 +320,12 @@ fs_visitor::calculate_live_intervals()
virtual_grf_end[i] = -1;
}

cfg_t cfg(&instructions);
this->live_intervals = new(mem_ctx) fs_live_variables(this, &cfg);
if (cfg) {
this->live_intervals = new(mem_ctx) fs_live_variables(this, cfg);
} else {
cfg_t cfg(&instructions);
this->live_intervals = new(mem_ctx) fs_live_variables(this, &cfg);
}

/* Merge the per-component live ranges to whole VGRF live ranges. */
for (int i = 0; i < live_intervals->num_vars; i++) {

+ 2
- 2
src/mesa/drivers/dri/i965/brw_fs_live_variables.h Datei anzeigen

@@ -57,7 +57,7 @@ class fs_live_variables {
public:
DECLARE_RALLOC_CXX_OPERATORS(fs_live_variables)

fs_live_variables(fs_visitor *v, cfg_t *cfg);
fs_live_variables(fs_visitor *v, const cfg_t *cfg);
~fs_live_variables();

bool vars_interfere(int a, int b);
@@ -97,7 +97,7 @@ protected:
void compute_start_end();

fs_visitor *v;
cfg_t *cfg;
const cfg_t *cfg;
void *mem_ctx;

};

+ 2
- 2
src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp Datei anzeigen

@@ -93,10 +93,10 @@ fs_visitor::opt_saturate_propagation()
{
bool progress = false;

calculate_live_intervals();

cfg_t cfg(&instructions);

calculate_live_intervals(&cfg);

for (int b = 0; b < cfg.num_blocks; b++) {
progress = opt_saturate_propagation_local(this, cfg.blocks[b])
|| progress;

Laden…
Abbrechen
Speichern