mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 18:50:17 +01:00
intel/brw: Print defs in dump_instructions
Like NIR, we print SSA defs as %1, %2, and so on. The number here is the VGRF number. VGRFs that don't correspond to a SSA def remain printed as vgrf1, vgrf2, and so on. This makes it much easier to see what values are SSA and which aren't. Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28666>
This commit is contained in:
parent
08da7edc0e
commit
2b30b3bbd4
2 changed files with 14 additions and 7 deletions
|
|
@ -2175,6 +2175,7 @@ void
|
|||
fs_visitor::dump_instructions_to_file(FILE *file) const
|
||||
{
|
||||
if (cfg && grf_used == 0) {
|
||||
const brw::def_analysis &defs = def_analysis.require();
|
||||
const register_pressure *rp =
|
||||
INTEL_DEBUG(DEBUG_REG_PRESSURE) ? ®pressure_analysis.require() : NULL;
|
||||
|
||||
|
|
@ -2191,7 +2192,7 @@ fs_visitor::dump_instructions_to_file(FILE *file) const
|
|||
|
||||
for (unsigned i = 0; i < cf_count; i++)
|
||||
fprintf(file, " ");
|
||||
dump_instruction(inst, file);
|
||||
dump_instruction(inst, file, &defs);
|
||||
ip++;
|
||||
|
||||
if (inst->is_control_flow_begin())
|
||||
|
|
@ -2473,7 +2474,7 @@ brw_instruction_name(const struct brw_isa_info *isa, enum opcode op)
|
|||
|
||||
|
||||
void
|
||||
fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file) const
|
||||
fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file, const brw::def_analysis *defs) const
|
||||
{
|
||||
if (inst->predicate) {
|
||||
fprintf(file, "(%cf%d.%d) ",
|
||||
|
|
@ -2512,7 +2513,10 @@ fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file) const
|
|||
|
||||
switch (inst->dst.file) {
|
||||
case VGRF:
|
||||
fprintf(file, "v%d", inst->dst.nr);
|
||||
if (defs && defs->get(inst->dst))
|
||||
fprintf(file, "%%%d", inst->dst.nr);
|
||||
else
|
||||
fprintf(file, "v%d", inst->dst.nr);
|
||||
break;
|
||||
case FIXED_GRF:
|
||||
fprintf(file, "g%d", inst->dst.nr);
|
||||
|
|
@ -2576,7 +2580,10 @@ fs_visitor::dump_instruction_to_file(const fs_inst *inst, FILE *file) const
|
|||
fprintf(file, "|");
|
||||
switch (inst->src[i].file) {
|
||||
case VGRF:
|
||||
fprintf(file, "v%d", inst->src[i].nr);
|
||||
if (defs && defs->get(inst->src[i]))
|
||||
fprintf(file, "%%%d", inst->src[i].nr);
|
||||
else
|
||||
fprintf(file, "v%d", inst->src[i].nr);
|
||||
break;
|
||||
case FIXED_GRF:
|
||||
fprintf(file, "g%d", inst->src[i].nr);
|
||||
|
|
|
|||
|
|
@ -362,12 +362,12 @@ public:
|
|||
fs_reg per_primitive_reg(const brw::fs_builder &bld,
|
||||
int location, unsigned comp);
|
||||
|
||||
void dump_instruction_to_file(const fs_inst *inst, FILE *file) const;
|
||||
void dump_instruction_to_file(const fs_inst *inst, FILE *file, const brw::def_analysis *defs) const;
|
||||
void dump_instructions_to_file(FILE *file) const;
|
||||
|
||||
/* Convenience functions based on the above. */
|
||||
void dump_instruction(const fs_inst *inst, FILE *file = stderr) const {
|
||||
dump_instruction_to_file(inst, file);
|
||||
void dump_instruction(const fs_inst *inst, FILE *file = stderr, const brw::def_analysis *defs = nullptr) const {
|
||||
dump_instruction_to_file(inst, file, defs);
|
||||
}
|
||||
void dump_instructions(const char *name = nullptr) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue