[llvm] [Utils] update_llc_test_checks.py: updated the regexp for ARM target (PR #148287)

Tommaso Fellegara via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 9 07:20:08 PDT 2025


https://github.com/Felle33 updated https://github.com/llvm/llvm-project/pull/148287

>From 884948fc0ec6e1db46117af87ace0ed14f6d29b0 Mon Sep 17 00:00:00 2001
From: tommi <tommi.felle at gmail.com>
Date: Fri, 11 Jul 2025 14:53:54 +0200
Subject: [PATCH 1/5] [Utils] update_llc_test_checks.py: updated the regexp for
 ARM target

---
 llvm/utils/UpdateTestChecks/asm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 3754aa2eeba85..ee70d837d7b7a 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -32,7 +32,7 @@ class string:
 )
 
 ASM_FUNCTION_ARM_RE = re.compile(
-    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*@+[ \t]*@"?(?P=func)"?\n'  # f: (name of function)
+    r'^(?P<func>[0-9a-zA-Z_$]+):[ \t]*(@+[ \t]*@"?(?P=func)"?)?\n'  # f: (name of function)
     r"(?:\.L(?P=func)\$local:\n)?"  # drop .L<func>$local:
     r"(?:\s*\.type\s+\.L(?P=func)\$local, at function\n)?"  # drop .type .L<func>$local
     r"\s+\.fnstart\n"  # .fnstart

>From d6828372267403b2afe1c93c11ec3740cfe05e54 Mon Sep 17 00:00:00 2001
From: tommi <tommi.felle at gmail.com>
Date: Mon, 28 Jul 2025 08:27:15 +0200
Subject: [PATCH 2/5] Update the regular expression ASM_FUNCTION_AARCH64_RE

---
 llvm/utils/UpdateTestChecks/asm.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index ee70d837d7b7a..27d936674f31b 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -42,11 +42,11 @@ class string:
 )
 
 ASM_FUNCTION_AARCH64_RE = re.compile(
-    r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?( (Function|Tail Call))?\n'
+    r'^_?(?P<func>[a-zA-Z][a-zA-Z0-9]*):[ \t]*(\/\/[ \t]*@"?(?P=func)"?)?( (Function|Tail Call))?\n'
     r"(?:[ \t]+.cfi_startproc\n)?"  # drop optional cfi noise
-    r"(?P<body>.*?)\n"
+    r"(?P<body>.*?)"
     # This list is incomplete
-    r"^\s*(\.Lfunc_end[0-9]+|// -- End function)",
+    r"^(\.Lfunc_end[0-9]+:|// -- End function)",
     flags=(re.M | re.S),
 )
 

>From 2e7fe27877d0c821b164623e03e47ea616025daa Mon Sep 17 00:00:00 2001
From: tommi <tommi.felle at gmail.com>
Date: Mon, 28 Jul 2025 08:44:36 +0200
Subject: [PATCH 3/5] Update the regular expression
 ASM_FUNCTION_THUMBS_DARWIN_RE

---
 llvm/utils/UpdateTestChecks/asm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 27d936674f31b..55470a27f45db 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -183,7 +183,7 @@ class string:
 )
 
 ASM_FUNCTION_THUMBS_DARWIN_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)\n"
     r"[ \t]*\.data_region\n",
     flags=(re.M | re.S),

>From 4bffdc29040eb6159c67d41b9dd7ea19f04aa5e5 Mon Sep 17 00:00:00 2001
From: tommi <tommi.felle at gmail.com>
Date: Mon, 28 Jul 2025 08:49:04 +0200
Subject: [PATCH 4/5] Update the regular expressions
 ASM_FUNCTION_THUMB_DARWIN_RE, ASM_FUNCTION_ARM_IOS_RE and
 ASM_FUNCTION_ARM_MACHO_RE

---
 llvm/utils/UpdateTestChecks/asm.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 55470a27f45db..a7e87b982916d 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -175,7 +175,7 @@ class string:
 )
 
 ASM_FUNCTION_ARM_MACHO_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"([ \t]*.cfi_startproc\n[ \t]*)?"
     r"(?P<body>.*?)\n"
     r"[ \t]*\.cfi_endproc\n",
@@ -190,14 +190,14 @@ class string:
 )
 
 ASM_FUNCTION_THUMB_DARWIN_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)\n"
     r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
     flags=(re.M | re.S),
 )
 
 ASM_FUNCTION_ARM_IOS_RE = re.compile(
-    r'^_(?P<func>[^:]+):[ \t]*@[ \t]@"?(?P=func)"?\n'
+    r'^_(?P<func>[^:]+):[ \t]*(@[ \t]@"?(?P=func)"?)?\n'
     r"(?P<body>.*?)"
     r"^[ \t]*@[ \t]--[ \t]End[ \t]function",
     flags=(re.M | re.S),

>From 6896951646891dad9431186360b8f01d09f2011c Mon Sep 17 00:00:00 2001
From: tommi <tommi.felle at gmail.com>
Date: Sat, 9 Aug 2025 16:19:44 +0200
Subject: [PATCH 5/5] Update the regular expression ASM_FUNCTION_AARCH64_RE

---
 llvm/utils/UpdateTestChecks/asm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index a7e87b982916d..da74f75274ca2 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -42,7 +42,7 @@ class string:
 )
 
 ASM_FUNCTION_AARCH64_RE = re.compile(
-    r'^_?(?P<func>[a-zA-Z][a-zA-Z0-9]*):[ \t]*(\/\/[ \t]*@"?(?P=func)"?)?( (Function|Tail Call))?\n'
+    r'^(?P<func>_?[a-zA-Z][^:]*):[ \t]*(\/\/[ \t]*@"?(?P=func)"?)?( (Function|Tail Call))?\n'
     r"(?:[ \t]+.cfi_startproc\n)?"  # drop optional cfi noise
     r"(?P<body>.*?)"
     # This list is incomplete



More information about the llvm-commits mailing list