mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
intel/compiler: Allow dumping CFG to a specific FILE*
Add optional argument for both cfg and block dump() function to pass a FILE*. Default behavior remains dumping to stderr. v2 (idr): Don't add the new test framework in this commit. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
This commit is contained in:
parent
21cf9323f0
commit
47c5656f0e
2 changed files with 14 additions and 14 deletions
|
|
@ -154,14 +154,14 @@ bblock_t::combine_with(bblock_t *that)
|
|||
}
|
||||
|
||||
void
|
||||
bblock_t::dump() const
|
||||
bblock_t::dump(FILE *file) const
|
||||
{
|
||||
const backend_shader *s = this->cfg->s;
|
||||
|
||||
int ip = this->start_ip;
|
||||
foreach_inst_in_block(backend_instruction, inst, this) {
|
||||
fprintf(stderr, "%5d: ", ip);
|
||||
s->dump_instruction(inst);
|
||||
fprintf(file, "%5d: ", ip);
|
||||
s->dump_instruction(inst, file);
|
||||
ip++;
|
||||
}
|
||||
}
|
||||
|
|
@ -578,32 +578,32 @@ cfg_t::make_block_array()
|
|||
}
|
||||
|
||||
void
|
||||
cfg_t::dump()
|
||||
cfg_t::dump(FILE *file)
|
||||
{
|
||||
const idom_tree *idom = (s ? &s->idom_analysis.require() : NULL);
|
||||
|
||||
foreach_block (block, this) {
|
||||
if (idom && idom->parent(block))
|
||||
fprintf(stderr, "START B%d IDOM(B%d)", block->num,
|
||||
fprintf(file, "START B%d IDOM(B%d)", block->num,
|
||||
idom->parent(block)->num);
|
||||
else
|
||||
fprintf(stderr, "START B%d IDOM(none)", block->num);
|
||||
fprintf(file, "START B%d IDOM(none)", block->num);
|
||||
|
||||
foreach_list_typed(bblock_link, link, link, &block->parents) {
|
||||
fprintf(stderr, " <%cB%d",
|
||||
fprintf(file, " <%cB%d",
|
||||
link->kind == bblock_link_logical ? '-' : '~',
|
||||
link->block->num);
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(file, "\n");
|
||||
if (s != NULL)
|
||||
block->dump();
|
||||
fprintf(stderr, "END B%d", block->num);
|
||||
block->dump(file);
|
||||
fprintf(file, "END B%d", block->num);
|
||||
foreach_list_typed(bblock_link, link, link, &block->children) {
|
||||
fprintf(stderr, " %c>B%d",
|
||||
fprintf(file, " %c>B%d",
|
||||
link->kind == bblock_link_logical ? '-' : '~',
|
||||
link->block->num);
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(file, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ struct bblock_t {
|
|||
enum bblock_link_kind kind) const;
|
||||
bool can_combine_with(const bblock_t *that) const;
|
||||
void combine_with(bblock_t *that);
|
||||
void dump() const;
|
||||
void dump(FILE *file = stderr) const;
|
||||
|
||||
backend_instruction *start();
|
||||
const backend_instruction *start() const;
|
||||
|
|
@ -339,7 +339,7 @@ struct cfg_t {
|
|||
void set_next_block(bblock_t **cur, bblock_t *block, int ip);
|
||||
void make_block_array();
|
||||
|
||||
void dump();
|
||||
void dump(FILE *file = stderr);
|
||||
void dump_cfg();
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue