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();
{
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];
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));
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);
* information about whole VGRFs.
*/
void
-fs_visitor::calculate_live_intervals()
+fs_visitor::calculate_live_intervals(const cfg_t *cfg)
{
if (this->live_intervals)
return;
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++) {
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);
void compute_start_end();
fs_visitor *v;
- cfg_t *cfg;
+ const cfg_t *cfg;
void *mem_ctx;
};
{
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;