From 54912281a028c4e1d01a7e3cf8d06eb088657597 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Fri, 28 Feb 2025 09:12:15 -0800 Subject: [PATCH] brw: Always verify EU compaction in debug mode There's already code to verify that any compacted instruction that we produce is equivalent to the original uncompacted instruction -- including detailed output if it fails. This patch enables this verification in debug build and will abort in case it fails. Reviewed-by: Paulo Zanoni Part-of: --- src/intel/compiler/brw_eu_compact.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/intel/compiler/brw_eu_compact.c b/src/intel/compiler/brw_eu_compact.c index 89487a4a379..ac1dfadd102 100644 --- a/src/intel/compiler/brw_eu_compact.c +++ b/src/intel/compiler/brw_eu_compact.c @@ -2371,15 +2371,14 @@ brw_compact_instructions(struct brw_codegen *p, int start_offset, if (try_compact_instruction(&c, dst, &inst)) { compacted_count++; - if (INTEL_DEBUG(DEBUG_VS | DEBUG_GS | DEBUG_TCS | DEBUG_TASK | - DEBUG_WM | DEBUG_CS | DEBUG_TES | DEBUG_MESH | - DEBUG_RT)) { - brw_eu_inst uncompacted; - uncompact_instruction(&c, &uncompacted, dst); - if (memcmp(&saved, &uncompacted, sizeof(uncompacted))) { - brw_debug_compact_uncompact(p->isa, &saved, &uncompacted); - } +#ifndef NDEBUG + brw_eu_inst uncompacted; + uncompact_instruction(&c, &uncompacted, dst); + if (memcmp(&saved, &uncompacted, sizeof(uncompacted))) { + brw_debug_compact_uncompact(p->isa, &saved, &uncompacted); + assert(false); } +#endif offset += sizeof(brw_eu_compact_inst); } else {