[llvm] update_test_checks: improve IR value name stability (PR #110940)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 16:48:55 PDT 2024


Nicolai =?utf-8?q?Hähnle?= <nicolai.haehnle at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/110940 at github.com>


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 616d1d2e998aa7a26059dc36fa04875c469f69cd...992462ad651591fefdbf57efcf80fc289e8d2256 llvm/utils/UpdateTestChecks/common.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- common.py	2024-10-02 23:37:59.000000 +0000
+++ common.py	2024-10-02 23:48:23.809726 +0000
@@ -1552,10 +1552,11 @@
                 # rhs_name -> lhs_name mappings required by this color
                 self.mapping = {}
 
                 # lhs_names committed for this color
                 self.committed = set()
+
         colors = []
 
         for match_idx, (lhs_idx, rhs_idx) in enumerate(candidate_matches):
             lhs_line = old_line_infos[lhs_idx]
             rhs_line = new_line_infos[rhs_idx]
@@ -1580,11 +1581,14 @@
                     if new_color.color[rhs_value.name] == lhs_value.name:
                         continue
                     else:
                         break
 
-                if lhs_value.name in committed_names or lhs_value.name in new_color.committed:
+                if (
+                    lhs_value.name in committed_names
+                    or lhs_value.name in new_color.committed
+                ):
                     # We can't map this value because the name we would map it
                     # to has already been committed for something else. Give up
                     # on this line.
                     break
 
@@ -1627,11 +1631,15 @@
                     and lhs_var in new_mapping
                     and new_mapping[lhs_var] == lhs_var
                 ):
                     new_mapping[lhs_var] = "conflict_" + lhs_var
 
-            matches = [(old_begin - 1, new_begin - 1)] + max_color.matches + [(old_end, new_end)]
+            matches = (
+                [(old_begin - 1, new_begin - 1)]
+                + max_color.matches
+                + [(old_end, new_end)]
+            )
 
             for (lhs_prev, rhs_prev), (lhs_next, rhs_next) in zip(matches, matches[1:]):
                 recurse(lhs_prev + 1, lhs_next, rhs_prev + 1, rhs_next)
 
     recurse(0, len(old_line_infos), 0, len(new_line_infos))

``````````

</details>


https://github.com/llvm/llvm-project/pull/110940


More information about the llvm-commits mailing list