agx: add parallel copy printing

useful for debugging.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Alyssa Rosenzweig 2024-01-26 14:30:46 -04:00 committed by Marge Bot
parent 871f3d3f7d
commit 42084d50e5
3 changed files with 23 additions and 1 deletions

View file

@ -874,6 +874,7 @@ agx_builder_insert(agx_cursor *cursor, agx_instr *I)
/* Routines defined for AIR */
void agx_print_index(agx_index index, bool is_float, FILE *fp);
void agx_print_instr(const agx_instr *I, FILE *fp);
void agx_print_block(const agx_block *block, FILE *fp);
void agx_print_shader(const agx_context *ctx, FILE *fp);

View file

@ -7,6 +7,27 @@
#include "agx_builder.h"
#include "agx_compiler.h"
UNUSED static void
print_copy(const struct agx_copy *cp)
{
printf("%sr%u = ", cp->dest_mem ? "m" : "", cp->dest);
agx_print_index(cp->src, false, stdout);
printf("\n");
}
UNUSED static void
print_copies(const struct agx_copy *copies, unsigned nr)
{
printf("[\n");
for (unsigned i = 0; i < nr; ++i) {
printf(" ");
print_copy(&copies[i]);
}
printf("]\n");
}
/*
* Emits code for
*

View file

@ -27,7 +27,7 @@ agx_print_sized(char prefix, unsigned value, enum agx_size size, FILE *fp)
unreachable("Invalid size");
}
static void
void
agx_print_index(agx_index index, bool is_float, FILE *fp)
{
if (index.memory)