Skip to content

Commit 99a1fca

Browse files
authored
[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 ```
1 parent 0c65351 commit 99a1fca

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 < %s | FileCheck %s
3+
4+
define private void @foo() {
5+
; CHECK-LABEL: foo:
6+
; CHECK: ; %bb.0:
7+
; CHECK-NEXT: s_wait_loadcnt_dscnt 0x0
8+
; CHECK-NEXT: s_wait_expcnt 0x0
9+
; CHECK-NEXT: s_wait_samplecnt 0x0
10+
; CHECK-NEXT: s_wait_bvhcnt 0x0
11+
; CHECK-NEXT: s_wait_kmcnt 0x0
12+
; CHECK-NEXT: s_setpc_b64 s[30:31]
13+
ret void
14+
}
15+
16+
@var = global ptr @foo

llvm/utils/UpdateTestChecks/asm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class string:
5151
)
5252

5353
ASM_FUNCTION_AMDGPU_RE = re.compile(
54-
r"\.type\s+_?(?P<func>[^,\n]+),@function\n"
54+
r"\.type\s+(_|\.L)?(?P<func>[^,\n]+),@function\n"
5555
r"(^\s*\.amdgpu_hsa_kernel (?P=func)\n)?"
56-
r'^_?(?P=func):(?:[ \t]*;+[ \t]*@"?(?P=func)"?)?\n'
56+
r'^(_|\.L)?(?P=func):(?:[ \t]*;+[ \t]*@"?(?P=func)"?)?\n'
5757
r"(?P<body>.*?)\n" # (body of the function)
5858
# This list is incomplete
5959
r"^\s*(\.Lfunc_end[0-9]+:\n|\.section)",

0 commit comments

Comments
 (0)