aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2022-04-22 12:49:15 -0700
committerMircea Trofin <mtrofin@google.com>2022-05-26 10:23:10 -0700
commitf15c60218d5c88c9f32942bce119e7ac25cb6d73 (patch)
tree108a1cce28d7ae63b5399ba45ba5c9153896000a /llvm/utils/UpdateTestChecks/asm.py
parent6af5f5697c8560e09c305d5cfd74a7bda0d4d311 (diff)
downloadllvm-f15c60218d5c88c9f32942bce119e7ac25cb6d73.zip
llvm-f15c60218d5c88c9f32942bce119e7ac25cb6d73.tar.gz
llvm-f15c60218d5c88c9f32942bce119e7ac25cb6d73.tar.bz2
[UpdateTestChecks] Auto-generate stub bodies for unused prefixes
This is scoped to autogenerated tests. The goal is to support having each RUN line specify a list of check-prefixes where one can specify potentially redundant prefixes. For example, for X86, if one specified prefixes for both AVX1 and AVX2, and the codegen happened to match today, one of the prefixes would be used and the onther one not. If the unused prefix were dropped, and later, codegen differences were introduced, one would have to go figure out where to add what prefix (paraphrasing https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html) To avoid getting errors due to unused prefixes, whole directories can be opted out (as discussed on that thread), but that means that tests that aren't autogenerated in such directories could have undetected unused prefix bugs. This patch proposes an alternative that both avoids the above, dir-level optout, and supports the main autogen scenario discussed first. The autogen tool appends at the end of the test file the list of unused prefixes, together with a note explaining that is the case. Each prefix is set up to always pass. This way, unexpected unused prefixes are easily discoverable, and expected cases "just work". Differential Revision: https://reviews.llvm.org/D124306
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index a00a817..b26c9a7 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -484,6 +484,6 @@ def add_checks(output_lines, comment_marker, prefix_list, func_dict,
func_name, global_vars_seen_dict, is_filtered):
# Label format is based on ASM string.
check_label_format = '{} %s-LABEL: %s%s%s'.format(comment_marker)
- common.add_checks(output_lines, comment_marker, prefix_list, func_dict,
- func_name, check_label_format, True, False,
- global_vars_seen_dict, is_filtered=is_filtered)
+ return common.add_checks(output_lines, comment_marker, prefix_list, func_dict,
+ func_name, check_label_format, True, False,
+ global_vars_seen_dict, is_filtered=is_filtered)