[PATCH] D142452: update_test_checks.py: match IR block labels

Jannik Silvanus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 04:43:33 PST 2023


jsilvanus added a comment.

The change looks reasonable to me.

Could you motivate the change in the description, and add a test demonstrating the behavior on unnamed labels (`br label %42`)?
Also, now that https://reviews.llvm.org/D142473 has landed, can you bump the version here?



================
Comment at: llvm/utils/UpdateTestChecks/common.py:852-864
+        var = get_name_from_ir_value_match(match)
+        nameless_value = get_nameless_value_from_match(match, nameless_values)
+        if may_clash_with_default_check_prefix_name(nameless_value.check_prefix, var):
+          warn("Change IR value name '%s' or use --prefix-filecheck-ir-name to prevent possible conflict"
+               " with scripted FileCheck name." % (var,))
+
+        key = (var, nameless_value.check_key)
----------------
Maybe you can split the part duplicated between this loop and the one below to something like

```
   (key, vars_dict) = get_key_and_dict_from_match(match, [args])
```
?


================
Comment at: llvm/utils/UpdateTestChecks/common.py:879
       # will not replace both of them. For now we work around this by
       # substituting until there is no more match.
+      transformed = []
----------------
This comment seems to refer to the former `while changed` loop.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142452/new/

https://reviews.llvm.org/D142452



More information about the llvm-commits mailing list