aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorYatao Wang <ningxinr@live.cn>2022-03-01 10:54:24 +0100
committerSebastian Neubauer <Sebastian.Neubauer@amd.com>2022-03-01 10:55:53 +0100
commit8565b6f9f2782b8b6757fe078c4de01b61ef9ea8 (patch)
tree03c3c13fe880a9f623fb64ac378cf36000f86b6f /llvm/utils/UpdateTestChecks/asm.py
parent9dd2d50984f5b02e19d3576812dc9b09ddcc9483 (diff)
downloadllvm-8565b6f9f2782b8b6757fe078c4de01b61ef9ea8.zip
llvm-8565b6f9f2782b8b6757fe078c4de01b61ef9ea8.tar.gz
llvm-8565b6f9f2782b8b6757fe078c4de01b61ef9ea8.tar.bz2
[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
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 95d17ba..bb59484 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -388,21 +388,6 @@ def scrub_asm_csky(asm, args):
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
-def get_triple_from_march(march):
- triples = {
- 'amdgcn': 'amdgcn',
- 'r600': 'r600',
- 'mips': 'mips',
- 'sparc': 'sparc',
- 'hexagon': 'hexagon',
- 've': 've',
- }
- for prefix, triple in triples.items():
- if march.startswith(prefix):
- return triple
- print("Cannot find a triple. Assume 'x86'", file=sys.stderr)
- return 'x86'
-
def get_run_handler(triple):
target_handlers = {
'i686': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
@@ -456,7 +441,7 @@ def get_run_handler(triple):
##### Generator of assembly CHECK lines
-def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict,
+def add_checks(output_lines, comment_marker, prefix_list, func_dict,
func_name, is_filtered):
# Label format is based on ASM string.
check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker)