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 <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33821>
This commit is contained in:
Caio Oliveira
2025-02-28 09:12:15 -08:00
committed by Marge Bot
parent a9592a0c15
commit 54912281a0
+7 -8
View File
@@ -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 {