[llvm] 6c8f447 - [ARM] Extend regression test for D154281

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 07:48:51 PDT 2023


Author: Jay Foad
Date: 2023-07-21T15:48:45+01:00
New Revision: 6c8f4472b488d2729bed73dbb5644854e1b3c312

URL: https://github.com/llvm/llvm-project/commit/6c8f4472b488d2729bed73dbb5644854e1b3c312
DIFF: https://github.com/llvm/llvm-project/commit/6c8f4472b488d2729bed73dbb5644854e1b3c312.diff

LOG: [ARM] Extend regression test for D154281

Add a test case with a larger call frame which does not satisfy
ARMFrameLowering::hasReservedCallFrame.

Added: 
    

Modified: 
    llvm/test/CodeGen/ARM/struct-byval-loop.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/ARM/struct-byval-loop.ll b/llvm/test/CodeGen/ARM/struct-byval-loop.ll
index 1157e775842927..7a38dec2434f79 100644
--- a/llvm/test/CodeGen/ARM/struct-byval-loop.ll
+++ b/llvm/test/CodeGen/ARM/struct-byval-loop.ll
@@ -1,12 +1,12 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
 ; RUN: llc -mtriple=arm--none-eabi < %s | FileCheck %s
 
-%t = type [20 x i32]
+%type_80 = type [20 x i32]
 
-declare void @func(ptr, ptr byval(%t))
+declare void @func_80(ptr, ptr byval(%type_80))
 
-define void @main() {
-; CHECK-LABEL: main:
+define void @test_80() {
+; CHECK-LABEL: test_80:
 ; CHECK:       @ %bb.0:
 ; CHECK-NEXT:    .save {r11, lr}
 ; CHECK-NEXT:    push {r11, lr}
@@ -25,7 +25,7 @@ define void @main() {
 ; CHECK-NEXT:    add r3, sp, #72
 ; CHECK-NEXT:    mov r0, #0
 ; CHECK-NEXT:    ldm r3, {r1, r2, r3}
-; CHECK-NEXT:    bl func
+; CHECK-NEXT:    bl func_80
 ; CHECK-NEXT:    add sp, sp, #152
 ; CHECK-NEXT:    pop {r11, lr}
 ; CHECK-NEXT:    mov pc, lr
@@ -33,7 +33,50 @@ define void @main() {
 ; CHECK-NEXT:  @ %bb.3:
 ; CHECK-NEXT:  .LCPI0_0:
 ; CHECK-NEXT:    .long 68 @ 0x44
-  %a = alloca %t
-  call void @func(ptr null, ptr %a)
+  %a = alloca %type_80
+  call void @func_80(ptr null, ptr %a)
+  ret void
+}
+
+%type_4000 = type [1000 x i32]
+
+declare void @func_4000(ptr, ptr byval(%type_4000))
+
+define void @test_4000() {
+; CHECK-LABEL: test_4000:
+; CHECK:       @ %bb.0:
+; CHECK-NEXT:    .save {r11, lr}
+; CHECK-NEXT:    push {r11, lr}
+; CHECK-NEXT:    .pad #4000
+; CHECK-NEXT:    sub sp, sp, #4000
+; CHECK-NEXT:    sub sp, sp, #920
+; CHECK-NEXT:    sub sp, sp, #3072
+; CHECK-NEXT:    add lr, sp, #3072
+; CHECK-NEXT:    ldr r1, .LCPI1_0
+; CHECK-NEXT:    add r0, lr, #920
+; CHECK-NEXT:    mov r2, sp
+; CHECK-NEXT:    add r0, r0, #12
+; CHECK-NEXT:  .LBB1_1: @ =>This Inner Loop Header: Depth=1
+; CHECK-NEXT:    ldr r3, [r0], #4
+; CHECK-NEXT:    subs r1, r1, #4
+; CHECK-NEXT:    str r3, [r2], #4
+; CHECK-NEXT:    bne .LBB1_1
+; CHECK-NEXT:  @ %bb.2:
+; CHECK-NEXT:    ldr r1, [sp, #3992]
+; CHECK-NEXT:    mov r0, #0
+; CHECK-NEXT:    ldr r2, [sp, #3996]
+; CHECK-NEXT:    ldr r3, [sp, #4000]
+; CHECK-NEXT:    bl func_4000
+; CHECK-NEXT:    add sp, sp, #920
+; CHECK-NEXT:    add sp, sp, #3072
+; CHECK-NEXT:    add sp, sp, #4000
+; CHECK-NEXT:    pop {r11, lr}
+; CHECK-NEXT:    mov pc, lr
+; CHECK-NEXT:    .p2align 2
+; CHECK-NEXT:  @ %bb.3:
+; CHECK-NEXT:  .LCPI1_0:
+; CHECK-NEXT:    .long 3988 @ 0xf94
+  %a = alloca %type_4000
+  call void @func_4000(ptr null, ptr %a)
   ret void
 }


        


More information about the llvm-commits mailing list