agx: Add AGX_MESA_DEBUG=nopreamble option

Useful both for ruling out issues with shader preambles as well as (in some
cases) making for a nicer reading experience of the compiled assembly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
This commit is contained in:
Alyssa Rosenzweig
2023-02-14 23:38:58 -05:00
committed by Marge Bot
parent c22a18c9af
commit 4b1f4b86ea
2 changed files with 4 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ static const struct debug_named_value agx_debug_options[] = {
{"novalidate",AGX_DBG_NOVALIDATE,"Skip IR validation in debug builds"},
{"noopt", AGX_DBG_NOOPT, "Disable backend optimizations"},
{"wait", AGX_DBG_WAIT, "Wait after all async instructions"},
{"nopreamble",AGX_DBG_NOPREAMBLE,"Do not use shader preambles"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
@@ -1909,6 +1910,7 @@ agx_optimize_nir(nir_shader *nir, unsigned *preamble_size)
NIR_PASS_V(nir, agx_nir_lower_address);
NIR_PASS_V(nir, nir_lower_int64);
if (likely(!(agx_debug & AGX_DBG_NOPREAMBLE)))
NIR_PASS_V(nir, agx_nir_opt_preamble, preamble_size);
/* Forming preambles may dramatically reduce the instruction count

View File

@@ -48,6 +48,7 @@ enum agx_dbg {
AGX_DBG_NOVALIDATE = BITFIELD_BIT(5),
AGX_DBG_NOOPT = BITFIELD_BIT(6),
AGX_DBG_WAIT = BITFIELD_BIT(7),
AGX_DBG_NOPREAMBLE = BITFIELD_BIT(8),
};
/* clang-format on */