intel/brw: Change cfg_t to refer to fs_visitor

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27861>
This commit is contained in:
Caio Oliveira 2024-02-19 22:45:39 -08:00 committed by Marge Bot
parent 1e3fbb1afe
commit 20dfee69c3
5 changed files with 12 additions and 14 deletions

View file

@ -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)) { \

View file

@ -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 */

View file

@ -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;

View file

@ -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)
{

View file

@ -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);
};