Some useful trace points that I had laying around.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>
#include "compiler/nir/nir.h"
#include "util/disk_cache.h"
#include "util/log.h"
+#include "util/perf/cpu_trace.h"
#include "freedreno_dev_info.h"
static void
emit_instructions(struct ir3_context *ctx)
{
+ MESA_TRACE_FUNC();
+
nir_function_impl *fxn = nir_shader_get_entrypoint(ctx->s);
/* some varying setup which can't be done in setup_input(): */
int ret = 0, max_bary;
bool progress;
+ MESA_TRACE_FUNC();
+
assert(!so->ir);
ctx = ir3_context_init(compiler, shader, so);
ir3_context_init(struct ir3_compiler *compiler, struct ir3_shader *shader,
struct ir3_shader_variant *so)
{
+ MESA_TRACE_FUNC();
+
struct ir3_context *ctx = rzalloc(NULL, struct ir3_context);
if (compiler->gen == 4) {
void
ir3_optimize_loop(struct ir3_compiler *compiler, nir_shader *s)
{
+ MESA_TRACE_FUNC();
+
bool progress;
unsigned lower_flrp = (s->options->lower_flrp16 ? 16 : 0) |
(s->options->lower_flrp32 ? 32 : 0) |
void
ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s)
{
+ MESA_TRACE_FUNC();
+
struct nir_lower_tex_options tex_options = {
.lower_rect = 0,
.lower_tg4_offsets = true,
struct nir_shader *s = shader->nir;
struct ir3_compiler *compiler = shader->compiler;
+ MESA_TRACE_FUNC();
+
NIR_PASS_V(s, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
ir3_glsl_type_size, nir_lower_io_lower_64bit_to_32);
void
ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
{
+ MESA_TRACE_FUNC();
+
if (ir3_shader_debug & IR3_DBG_DISASM) {
mesa_logi("----------------------");
nir_log_shaderi(s);
const struct ir3_shader_key *key, bool binning_pass,
bool write_disasm, bool *created)
{
+ MESA_TRACE_FUNC();
+
mtx_lock(&shader->variants_lock);
struct ir3_shader_variant *v = shader_variant(shader, key);
return entry->data;
}
+ MESA_TRACE_FUNC();
+
if (key->hs)
assert(key->ds);
struct ir3_shader_variant *v;
bool created = false;
+ MESA_TRACE_FUNC();
+
/* Some shader key values may not be used by a given ir3_shader (for
* example, fragment shader saturates in the vertex shader), so clean out
* those flags to avoid recompiling.
struct ir3_shader_state *hwcso = job;
struct util_debug_callback debug = {};
+ MESA_TRACE_FUNC();
+
create_initial_variants(hwcso, &debug);
}
struct util_debug_callback debug = {};
static struct ir3_shader_key key; /* static is implicitly zeroed */
+ MESA_TRACE_FUNC();
+
ir3_shader_variant(shader, key, false, &debug);
shader->initial_variants_done = true;
}
if (!hwcso)
return NULL;
+ MESA_TRACE_FUNC();
+
struct ir3_shader *shader = hwcso->shader;
perf_time (1000, "waited for %s:%s:%s variants",
_mesa_shader_stage_to_abbrev(shader->type),
{
struct fd_screen *screen = fd_screen(pscreen);
+ MESA_TRACE_FUNC();
+
ir3_nir_lower_io_to_temporaries(nir);
ir3_finalize_nir(screen->compiler, nir);