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:

committed by
Marge Bot

parent
c22a18c9af
commit
4b1f4b86ea
@@ -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,7 +1910,8 @@ agx_optimize_nir(nir_shader *nir, unsigned *preamble_size)
|
||||
NIR_PASS_V(nir, agx_nir_lower_address);
|
||||
NIR_PASS_V(nir, nir_lower_int64);
|
||||
|
||||
NIR_PASS_V(nir, agx_nir_opt_preamble, preamble_size);
|
||||
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
|
||||
* in certain blocks, causing some if-else statements to become
|
||||
|
@@ -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 */
|
||||
|
||||
|
Reference in New Issue
Block a user