xref: /aosp_15_r20/external/llvm/test/CodeGen/Thumb/PR17309.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple thumbv5-none-linux-gnueabi < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker%struct.C = type { [1000 x i8] }
4*9880d681SAndroid Build Coastguard Worker%struct.S = type { [1000 x i16] }
5*9880d681SAndroid Build Coastguard Worker%struct.I = type { [1000 x i32] }
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker;CHECK-LABEL: pass_C:
8*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: ldrb    r{{[0-9]+}}, [{{.*}}], #1
9*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: strb    r{{[0-9]+}}, [{{.*}}], #1
10*9880d681SAndroid Build Coastguard Workerdefine void @pass_C() #0 {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker  %c = alloca %struct.C, align 1
13*9880d681SAndroid Build Coastguard Worker  %0 = getelementptr inbounds %struct.C, %struct.C* %c, i32 0, i32 0, i32 0
14*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.start(i64 1000, i8* %0) #1
15*9880d681SAndroid Build Coastguard Worker  call void @use_C(%struct.C* byval %c) #3
16*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.end(i64 1000, i8* %0) #1
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker;CHECK-LABEL: pass_S:
21*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: ldrh    r{{[0-9]+}}, [{{.*}}], #2
22*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: strh    r{{[0-9]+}}, [{{.*}}], #2
23*9880d681SAndroid Build Coastguard Workerdefine void @pass_S() #0 {
24*9880d681SAndroid Build Coastguard Workerentry:
25*9880d681SAndroid Build Coastguard Worker  %s = alloca %struct.S, align 2
26*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.S* %s to i8*
27*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.start(i64 2000, i8* %0) #1
28*9880d681SAndroid Build Coastguard Worker  call void @use_S(%struct.S* byval %s) #3
29*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.end(i64 2000, i8* %0) #1
30*9880d681SAndroid Build Coastguard Worker  ret void
31*9880d681SAndroid Build Coastguard Worker}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker;CHECK-LABEL: pass_I:
34*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: ldr     r{{[0-9]+}}, [{{.*}}], #4
35*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: str     r{{[0-9]+}}, [{{.*}}], #4
36*9880d681SAndroid Build Coastguard Workerdefine void @pass_I() #0 {
37*9880d681SAndroid Build Coastguard Workerentry:
38*9880d681SAndroid Build Coastguard Worker  %i = alloca %struct.I, align 4
39*9880d681SAndroid Build Coastguard Worker  %0 = bitcast %struct.I* %i to i8*
40*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.start(i64 4000, i8* %0) #1
41*9880d681SAndroid Build Coastguard Worker  call void @use_I(%struct.I* byval %i) #3
42*9880d681SAndroid Build Coastguard Worker  call void @llvm.lifetime.end(i64 4000, i8* %0) #1
43*9880d681SAndroid Build Coastguard Worker  ret void
44*9880d681SAndroid Build Coastguard Worker}
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerdeclare void @use_C(%struct.C* byval) #2
47*9880d681SAndroid Build Coastguard Workerdeclare void @use_S(%struct.S* byval) #2
48*9880d681SAndroid Build Coastguard Workerdeclare void @use_I(%struct.I* byval) #2
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.lifetime.start(i64, i8* nocapture) #1
51*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.lifetime.end(i64, i8* nocapture) #1
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
55*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind }
56*9880d681SAndroid Build Coastguard Workerattributes #2 = { optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
57*9880d681SAndroid Build Coastguard Workerattributes #3 = { nounwind optsize }
58