[llvm] 2616e00 - [update_llc_test_checks][VE] Handle .Lfoo$local in function regex

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 07:17:54 PDT 2022


Author: Alex Richardson
Date: 2022-08-24T14:16:20Z
New Revision: 2616e00949b18f5bd1223cb6054f7ad8ffa7e9c8

URL: https://github.com/llvm/llvm-project/commit/2616e00949b18f5bd1223cb6054f7ad8ffa7e9c8
DIFF: https://github.com/llvm/llvm-project/commit/2616e00949b18f5bd1223cb6054f7ad8ffa7e9c8.diff

LOG: [update_llc_test_checks][VE] Handle .Lfoo$local in function regex

While working on https://reviews.llvm.org/D131429, I got a test diff in
one of the VE tests and running update_llc_test_checks.py deleted all the
code for that function. This updates the regex to handle this new output.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D131431

Added: 
    

Modified: 
    llvm/test/CodeGen/VE/Scalar/builtin_sjlj_landingpad.ll
    llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ve-basic.ll.expected
    llvm/utils/UpdateTestChecks/asm.py

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/VE/Scalar/builtin_sjlj_landingpad.ll b/llvm/test/CodeGen/VE/Scalar/builtin_sjlj_landingpad.ll
index 6abb9bc676996..a998787b3eb77 100644
--- a/llvm/test/CodeGen/VE/Scalar/builtin_sjlj_landingpad.ll
+++ b/llvm/test/CodeGen/VE/Scalar/builtin_sjlj_landingpad.ll
@@ -257,36 +257,6 @@ define dso_local i32 @foo(i32 %arg) local_unnamed_addr personality i8* bitcast (
 ; PIC-NEXT:    bsic %s10, (, %s12)
 ; PIC-NEXT:    or %s0, 1, (0)1
 ; PIC-NEXT:    br.l.t .LBB0_2
-; PIC-NEXT:  .Lfunc_end0:
-; PIC-NEXT:    .size	foo, .Lfunc_end0-foo
-; PIC-NEXT:    .section	.rodata,"a", at progbits
-; PIC-NEXT:    .p2align	2
-; PIC-NEXT:  .LJTI0_0:
-; PIC-NEXT:    .4byte	.LBB0_6-foo
-; PIC-NEXT:    .section	.gcc_except_table,"a", at progbits
-; PIC-NEXT:    .p2align	2
-; PIC-NEXT:  GCC_except_table0:
-; PIC-NEXT:  .Lexception0:
-; PIC-NEXT:    .byte	255 # @LPStart Encoding = omit
-; PIC-NEXT:    .byte	0 # @TType Encoding = absptr
-; PIC-NEXT:    .uleb128 .Lttbase0-.Lttbaseref0
-; PIC-NEXT:  .Lttbaseref0:
-; PIC-NEXT:    .byte	3 # Call site Encoding = udata4
-; PIC-NEXT:    .uleb128 .Lcst_end0-.Lcst_begin0
-; PIC-NEXT:  .Lcst_begin0:
-; PIC-NEXT:    .byte	0 # >> Call Site 0 <<
-; PIC-NEXT:        #   On exception at call site 0
-; PIC-NEXT:    .byte	1 #   Action: 1
-; PIC-NEXT:  .Lcst_end0:
-; PIC-NEXT:    .byte	1 # >> Action Record 1 <<
-; PIC-NEXT:        #   Catch TypeInfo 1
-; PIC-NEXT:    .byte	0 #   No further actions
-; PIC-NEXT:    .p2align	2
-; PIC-NEXT:        # >> Catch TypeInfos <<
-; PIC-NEXT:    .8byte	SomeGlobal                      # TypeInfo 1
-; PIC-NEXT:  .Lttbase0:
-; PIC-NEXT:    .p2align	2
-; PIC-NEXT:        # -- End function
 entry:
   invoke void @errorbar() to label %exit unwind label %handle
 

diff  --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ve-basic.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ve-basic.ll.expected
index 5296c3f9792f3..5fa2bdd663642 100644
--- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ve-basic.ll.expected
+++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ve-basic.ll.expected
@@ -41,6 +41,42 @@ define dso_local i32 @dsolocal() {
 ; CHECK-NEXT:    ld %s10, 8(, %s11)
 ; CHECK-NEXT:    ld %s9, (, %s11)
 ; CHECK-NEXT:    b.l.t (, %s10)
+;
+; PIC-LABEL: dsolocal:
+; PIC:       # %bb.0: # %entry
+; PIC-NEXT:    st %s9, (, %s11)
+; PIC-NEXT:    st %s10, 8(, %s11)
+; PIC-NEXT:    st %s15, 24(, %s11)
+; PIC-NEXT:    st %s16, 32(, %s11)
+; PIC-NEXT:    or %s9, 0, %s11
+; PIC-NEXT:    lea %s11, -240(, %s11)
+; PIC-NEXT:    brge.l.t %s11, %s8, .LBB1_2
+; PIC-NEXT:  # %bb.1: # %entry
+; PIC-NEXT:    ld %s61, 24(, %s14)
+; PIC-NEXT:    or %s62, 0, %s0
+; PIC-NEXT:    lea %s63, 315
+; PIC-NEXT:    shm.l %s63, (%s61)
+; PIC-NEXT:    shm.l %s8, 8(%s61)
+; PIC-NEXT:    shm.l %s11, 16(%s61)
+; PIC-NEXT:    monc
+; PIC-NEXT:    or %s0, 0, %s62
+; PIC-NEXT:  .LBB1_2: # %entry
+; PIC-NEXT:    lea %s15, _GLOBAL_OFFSET_TABLE_ at pc_lo(-24)
+; PIC-NEXT:    and %s15, %s15, (32)0
+; PIC-NEXT:    sic %s16
+; PIC-NEXT:    lea.sl %s15, _GLOBAL_OFFSET_TABLE_ at pc_hi(%s16, %s15)
+; PIC-NEXT:    lea %s12, ext at plt_lo(-24)
+; PIC-NEXT:    and %s12, %s12, (32)0
+; PIC-NEXT:    sic %s16
+; PIC-NEXT:    lea.sl %s12, ext at plt_hi(%s16, %s12)
+; PIC-NEXT:    bsic %s10, (, %s12)
+; PIC-NEXT:    or %s0, 2, (0)1
+; PIC-NEXT:    or %s11, 0, %s9
+; PIC-NEXT:    ld %s16, 32(, %s11)
+; PIC-NEXT:    ld %s15, 24(, %s11)
+; PIC-NEXT:    ld %s10, 8(, %s11)
+; PIC-NEXT:    ld %s9, (, %s11)
+; PIC-NEXT:    b.l.t (, %s10)
 entry:
   call void @ext()
   ret i32 2

diff  --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 7e3bfdc7eea33..db853ea4600ec 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -170,6 +170,9 @@ class string:
 
 ASM_FUNCTION_VE_RE = re.compile(
     r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
+    r'(?:\s*\.?L(?P=func)\$local:\n)?'  # optional .L<func>$local: due to -fno-semantic-interposition
+    r'(?:\s*\.type\s+\.?L(?P=func)\$local, at function\n)?'  # optional .type .L<func>$local
+    r'(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
     r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
     r'.Lfunc_end[0-9]+:\n',
     flags=(re.M | re.S))


        


More information about the llvm-commits mailing list