diff --git a/src/intel/compiler/brw_cfg.cpp b/src/intel/compiler/brw_cfg.cpp index 3f30b71ce2b..e66b6e56d37 100644 --- a/src/intel/compiler/brw_cfg.cpp +++ b/src/intel/compiler/brw_cfg.cpp @@ -189,7 +189,7 @@ bblock_t::unlink_list(exec_list *list) } } -cfg_t::cfg_t(const backend_shader *s, exec_list *instructions) : +cfg_t::cfg_t(const fs_visitor *s, exec_list *instructions) : s(s) { mem_ctx = ralloc_context(NULL); @@ -735,6 +735,14 @@ cfg_t::dump_cfg() printf("}\n"); } +void +fs_visitor::calculate_cfg() +{ + if (this->cfg) + return; + cfg = new(mem_ctx) cfg_t(this, &this->instructions); +} + #define cfgv_assert(assertion) \ { \ if (!(assertion)) { \ diff --git a/src/intel/compiler/brw_cfg.h b/src/intel/compiler/brw_cfg.h index c3da9eca940..a1e7b2c6a23 100644 --- a/src/intel/compiler/brw_cfg.h +++ b/src/intel/compiler/brw_cfg.h @@ -74,7 +74,6 @@ struct bblock_link { }; struct fs_visitor; -struct backend_shader; struct cfg_t; struct bblock_t { @@ -326,7 +325,7 @@ struct cfg_t { #ifdef __cplusplus DECLARE_RALLOC_CXX_OPERATORS(cfg_t) - cfg_t(const backend_shader *s, exec_list *instructions); + cfg_t(const fs_visitor *s, exec_list *instructions); ~cfg_t(); void remove_block(bblock_t *block); @@ -355,7 +354,7 @@ struct cfg_t { inline void adjust_block_ips(); #endif - const struct backend_shader *s; + const struct fs_visitor *s; void *mem_ctx; /** Ordered list (by ip) of basic blocks */ diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 68b8914ce3e..295faee99a5 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -290,6 +290,7 @@ public: virtual void dump_instruction_to_file(const backend_instruction *inst, FILE *file) const; virtual void dump_instructions_to_file(FILE *file) const; + void calculate_cfg(); const brw_base_prog_key *const key; diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_shader.cpp index 01c338c08c4..eed30ea362c 100644 --- a/src/intel/compiler/brw_shader.cpp +++ b/src/intel/compiler/brw_shader.cpp @@ -1145,14 +1145,6 @@ backend_shader::dump_instructions_to_file(FILE *file) const } } -void -backend_shader::calculate_cfg() -{ - if (this->cfg) - return; - cfg = new(mem_ctx) cfg_t(this, &this->instructions); -} - void backend_shader::invalidate_analysis(brw::analysis_dependency_class c) { diff --git a/src/intel/compiler/brw_shader.h b/src/intel/compiler/brw_shader.h index 2da97775db9..caaee2cd7c6 100644 --- a/src/intel/compiler/brw_shader.h +++ b/src/intel/compiler/brw_shader.h @@ -87,8 +87,6 @@ public: } void dump_instructions(const char *name = nullptr) const; - void calculate_cfg(); - virtual void invalidate_analysis(brw::analysis_dependency_class c); };