mesa/src/amd/compiler/tests
Rhys Perry 9fe3af1e2a aco: insert s_nop before discard early exit sendmsg(dealloc_vgpr)
Forgot about this one.

fossil-db (gfx1100):
Totals from 3920 (2.94% of 133461) affected shaders:
Instrs: 6632088 -> 6636008 (+0.06%)
CodeSize: 34165376 -> 34181056 (+0.05%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 37fbfa655a ("aco: insert s_nop before VGPR deallocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29770>
2024-06-18 20:17:38 +00:00
..
check_output.py aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
framework.h aco/tests: support GFX12 2024-05-14 20:50:27 +00:00
glsl_scraper.py meson: remove --depfile for aco_tests 2024-05-30 09:44:52 +00:00
helpers.cpp aco: move live var information into struct Program 2024-06-14 14:32:35 +00:00
helpers.h aco/ra: remove gfx6/7 subdword paths 2024-05-02 11:09:35 +00:00
main.cpp aco/tests: don't assume constructor order 2024-04-16 15:46:19 +00:00
meson.build meson: remove --depfile for aco_tests 2024-05-30 09:44:52 +00:00
README.md aco/tests: add tests for form_hard_clauses() 2021-06-03 03:49:07 +00:00
test_assembler.cpp aco: use GFX12 scope/temporal-hint 2024-06-07 13:22:42 +00:00
test_builder.cpp aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
test_d3d11_derivs.cpp radv: emit discard as demote by default 2024-06-17 19:37:15 +00:00
test_hard_clause.cpp aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
test_insert_nops.cpp aco: support GFX12 in insert_NOPs 2024-05-28 10:52:11 +00:00
test_insert_waitcnt.cpp aco/waitcnt: support GFX12 in waitcnt pass 2024-05-20 10:45:39 +00:00
test_isel.cpp aco: insert s_nop before discard early exit sendmsg(dealloc_vgpr) 2024-06-18 20:17:38 +00:00
test_lower_subdword.cpp aco: add tests for lower_subdword 2024-05-02 11:09:35 +00:00
test_optimizer.cpp aco/gfx11+: optimize v_fma_mix throughput 2024-05-08 19:36:07 +00:00
test_optimizer_postRA.cpp aco/tests/post_ra: fix various validation errors 2024-04-25 09:47:18 +00:00
test_reduce_assign.cpp aco/tests: Insert p_logical_start/end in reduce_temp tests 2024-05-14 13:54:34 +00:00
test_regalloc.cpp aco/ra: use round robin register allocation 2024-06-06 21:02:15 +00:00
test_scheduler.cpp aco/tests: add tests for VOPD operand swapping 2024-02-08 12:15:23 +00:00
test_sdwa.cpp aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
test_tests.cpp aco: use SPDX-License-Identifier 2024-04-08 15:49:25 +00:00
test_to_hw_instr.cpp aco/gfx11: use v_swap_b16 2024-05-13 18:42:19 +00:00

Tests are wrapped in a BEGIN_TEST/END_TEST and write data to the output file pointer. Tests have checks against the output. They are single line comments prefixed with certain characters:

  • ! fails the test if the current line does not match the pattern
  • >> skips to the first line which matches the pattern, or fails the test if there is none
  • ; executes python code to extend the pattern syntax by inserting functions into the variable dictionary, fail the test, insert more checks or consume characters from the output

Before this prefix, there can be a ~ to only perform the check for certain variants (a regex directly following the ~ is used).

Pattern Syntax

Patterns can define variables which can be accessed in both python code and the pattern itself. These are useful for readability or dealing with unstable identifiers in the output. Variable identifiers are sequences of digits, ascii letters or _ (though they cannot start with a digit).

  • \ can be used to match the following literal character without interpreting it.
  • Most characters expect the same characters in the output.
  • A sequence of spaces in the pattern expects a sequence of spaces or tabs in the output.
  • A # in the pattern expects an unsigned integer in the output. The # can be followed by an identifier to store the integer in a variable.
  • A $ in the pattern stores the output until the first whitespace character into a variable.
  • A % in the pattern followed by an identifier is the same as a # but it expects a % before the integer in the output. It basically matches a ACO temporary.
  • A @ calls a variable as a function. It can be followed by an argument string wrapped in ( and ).

Functions

  • s64, s96, s128, v2, v3, etc, expand to a pattern which matches a disassembled instruction's definition or operand. It later checks that the size and alignment is what's expected.
  • match_func expands to a sequence of $ and inserts functions with expand to the extracted output
  • search_re consumes the rest of the line and fails the test if the pattern is not found