[clang] [llvm] [Arm] Generate explicit bitcasts in NeonEmitter (PR #121802)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 09:16:12 PST 2025


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 7cb6e6bced8ca5767c3e609f4826982638fd9543...27c8a1e77e90645013be2b1c93f3d6eb4cd2e11f llvm/utils/UpdateTestChecks/common.py llvm/utils/update_cc_test_checks.py
``````````

</details>

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

``````````diff
--- UpdateTestChecks/common.py	2025-01-06 15:08:27.000000 +0000
+++ UpdateTestChecks/common.py	2025-01-06 17:15:38.320891 +0000
@@ -556,12 +556,11 @@
 UTC_ADVERT = "NOTE: Assertions have been autogenerated by "
 UTC_AVOID = "NOTE: Do not autogenerate"
 UNUSED_NOTE = "NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:"
 
 DATA_LAYOUT_RE = re.compile(
-    r"target\sdatalayout\s=\s\"(?P<layout>.+)\"$",
-    flags=(re.M | re.S)
+    r"target\sdatalayout\s=\s\"(?P<layout>.+)\"$", flags=(re.M | re.S)
 )
 
 OPT_FUNCTION_RE = re.compile(
     r"^(\s*;\s*Function\sAttrs:\s(?P<attrs>[\w\s():,]+?))?\s*define\s+(?P<funcdef_attrs_and_ret>[^@]*)@(?P<func>[\w.$-]+?)\s*"
     r"(?P<args_and_sig>\((\)|(.*?[\w.-]+?)\))[^{]*\{)\n(?P<body>.*?)^\}$",
@@ -653,20 +652,22 @@
         if march.startswith(prefix):
             return triple
     print("Cannot find a triple. Assume 'x86'", file=sys.stderr)
     return "x86"
 
+
 def get_global_underscores(raw_tool_output):
     m = DATA_LAYOUT_RE.search(raw_tool_output)
     if not m:
         return False
     data_layout = m.group("layout")
     idx = data_layout.find("m:")
     if idx < 0:
         return False
     ch = data_layout[idx + 2]
-    return ch == 'o' or ch == 'x'
+    return ch == "o" or ch == "x"
+
 
 def apply_filters(line, filters):
     has_filter = False
     for f in filters:
         if not f.is_filter_out:
--- update_cc_test_checks.py	2025-01-06 15:08:27.000000 +0000
+++ update_cc_test_checks.py	2025-01-06 17:15:38.542123 +0000
@@ -123,11 +123,11 @@
             search = spell
         mangled = node.get("mangledName", spell)
         # Strip leading underscore from globals, so the name matches the LLVM one
         if global_underscores:
             storage = node.get("storageClass", None)
-            if storage != "static" and mangled[0] == '_':
+            if storage != "static" and mangled[0] == "_":
                 mangled = mangled[1:]
         ret[int(line) - 1].append((spell, mangled, search))
 
     ast = json.loads(stdout)
     if ast["kind"] != "TranslationUnitDecl":
@@ -252,11 +252,13 @@
         args.opt = None
 
     return args, parser
 
 
-def get_function_body(builder, args, filename, clang_args, extra_commands, prefixes, raw_tool_output):
+def get_function_body(
+    builder, args, filename, clang_args, extra_commands, prefixes, raw_tool_output
+):
     # TODO Clean up duplication of asm/common build_function_body_dictionary
     for extra_command in extra_commands:
         extra_args = shlex.split(extra_command)
         with tempfile.NamedTemporaryFile() as f:
             f.write(raw_tool_output.encode())
@@ -387,16 +389,24 @@
             common.debug("Extracted FileCheck prefixes: {}".format(prefixes))
 
             # Invoke external tool and extract function bodies.
             raw_tool_output = common.invoke_tool(ti.args.clang, clang_args, ti.path)
             get_function_body(
-                builder, ti.args, ti.path, clang_args, extra_commands, prefixes, raw_tool_output
+                builder,
+                ti.args,
+                ti.path,
+                clang_args,
+                extra_commands,
+                prefixes,
+                raw_tool_output,
             )
 
             # Invoke clang -Xclang -ast-dump=json to get mapping from start lines to
             # mangled names. Forward all clang args for now.
-            for k, v in get_line2func_list(ti.args, clang_args, common.get_global_underscores(raw_tool_output)).items():
+            for k, v in get_line2func_list(
+                ti.args, clang_args, common.get_global_underscores(raw_tool_output)
+            ).items():
                 line2func_list[k].extend(v)
 
         func_dict = builder.finish_and_get_func_dict()
         global_vars_seen_dict = {}
         prefix_set = set([prefix for p in filecheck_run_list for prefix in p[0]])

``````````

</details>


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


More information about the llvm-commits mailing list