[llvm] 99a1fca - [UTC] Update AMDGPU asm regexp for private functions (#166169)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 03:59:48 PST 2025
Author: Jay Foad
Date: 2025-11-04T11:59:43Z
New Revision: 99a1fcad5de62d849cc5ac31a8b3412ead5b5518
URL: https://github.com/llvm/llvm-project/commit/99a1fcad5de62d849cc5ac31a8b3412ead5b5518
DIFF: https://github.com/llvm/llvm-project/commit/99a1fcad5de62d849cc5ac31a8b3412ead5b5518.diff
LOG: [UTC] Update AMDGPU asm regexp for private functions (#166169)
Since #163011 changed AMDGPU to use ELF mangling, the regexp failed to
match private functions because of the inconsistent presence/absence of
the .L prefix on the first line of the function e.g.:
```
.Lfoo: ; @foo
```
Added:
llvm/test/CodeGen/AMDGPU/private-function.ll
Modified:
llvm/utils/UpdateTestChecks/asm.py
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AMDGPU/private-function.ll b/llvm/test/CodeGen/AMDGPU/private-function.ll
new file mode 100644
index 0000000000000..8eefc9dfc5d7e
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/private-function.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 < %s | FileCheck %s
+
+define private void @foo() {
+; CHECK-LABEL: foo:
+; CHECK: ; %bb.0:
+; CHECK-NEXT: s_wait_loadcnt_dscnt 0x0
+; CHECK-NEXT: s_wait_expcnt 0x0
+; CHECK-NEXT: s_wait_samplecnt 0x0
+; CHECK-NEXT: s_wait_bvhcnt 0x0
+; CHECK-NEXT: s_wait_kmcnt 0x0
+; CHECK-NEXT: s_setpc_b64 s[30:31]
+ ret void
+}
+
+ at var = global ptr @foo
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 61f0d679f806d..82377862885c8 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -51,9 +51,9 @@ class string:
)
ASM_FUNCTION_AMDGPU_RE = re.compile(
- r"\.type\s+_?(?P<func>[^,\n]+), at function\n"
+ r"\.type\s+(_|\.L)?(?P<func>[^,\n]+), at function\n"
r"(^\s*\.amdgpu_hsa_kernel (?P=func)\n)?"
- r'^_?(?P=func):(?:[ \t]*;+[ \t]*@"?(?P=func)"?)?\n'
+ r'^(_|\.L)?(?P=func):(?:[ \t]*;+[ \t]*@"?(?P=func)"?)?\n'
r"(?P<body>.*?)\n" # (body of the function)
# This list is incomplete
r"^\s*(\.Lfunc_end[0-9]+:\n|\.section)",
More information about the llvm-commits
mailing list