[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py
authorYatao Wang <ningxinr@live.cn>
Tue, 1 Mar 2022 09:54:24 +0000 (10:54 +0100)
committerSebastian Neubauer <Sebastian.Neubauer@amd.com>
Tue, 1 Mar 2022 09:55:53 +0000 (10:55 +0100)
commit8565b6f9f2782b8b6757fe078c4de01b61ef9ea8
tree03c3c13fe880a9f623fb64ac378cf36000f86b6f
parent9dd2d50984f5b02e19d3576812dc9b09ddcc9483
[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py

Add a check on run lines to pick up isel options in llc commands and allow
generating check lines of isel final output other than assembly. If llc command
line contains -debug-only=isel, update_llc_test_checks.py will try to scrub isel
output, otherwise, the script will fall back on default behaviour, which is try to
scrub assembly output instead.

The motivation of this change is to allow usage of update_llc_test_checks.py to
autogenerate checks of instruction selection results. In this way, we can detect
errors at an earlier stage before the compilation goes all the way to assembly.
It is an example of having some transparency for the stages between IR and
assembly. These generated tests are almost like "unit tests" of isel stage.

This patch only implements the initial change to differentiate isel output from
assembly output for Lanai. Other targets will not be supported for isel check
generation at the moment. Although adding support for it will only require
implementing the function regex and scrubber for corresponding targets.

The Lanai implementation was chosen mainly for the simplicity of demonstrating
the difference between isel checks and asm checks.

This patch also do not include the implementation of function prefix, which is
required for the generated isel checks to pass. I will put up a follow up revision
for the function prefix change to complete isel support.

Reviewed By: Flakebi

Differential Revision: https://reviews.llvm.org/D119368
20 files changed:
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_asm.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_asm.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_isel.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/amdgpu_isel.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_asm.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_asm.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_isel.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/lanai_isel.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_asm.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_asm.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_isel.ll [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86_isel.ll.expected [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/amdgpu-isel-support.test [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/lanai-isel-support.test [new file with mode: 0644]
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/x86-isel-support.test [new file with mode: 0644]
llvm/utils/UpdateTestChecks/asm.py
llvm/utils/UpdateTestChecks/common.py
llvm/utils/UpdateTestChecks/isel.py [new file with mode: 0644]
llvm/utils/update_cc_test_checks.py
llvm/utils/update_llc_test_checks.py