1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
6 ; CHECK-DAG: memw(r29+#4) = ##875770417
7 ; CHECK-DAG: memw(r29+#8) = #51
8 ; CHECK-DAG: memh(r29+#12) = #50
9 ; CHECK-DAG: memb(r29+#15) = #49
10 define void @test1() {
12 %v1 = alloca [1 x i8], align 1
13 %v2 = alloca i16, align 2
14 %v3 = alloca i32, align 4
15 %v4 = alloca i32, align 4
16 %v5 = getelementptr inbounds [1 x i8], [1 x i8]* %v1, i32 0, i32 0
17 call void @llvm.lifetime.start(i64 1, i8* %v5)
18 store i8 49, i8* %v5, align 1
19 %v6 = bitcast i16* %v2 to i8*
20 call void @llvm.lifetime.start(i64 2, i8* %v6)
21 store i16 50, i16* %v2, align 2
22 %v7 = bitcast i32* %v3 to i8*
23 call void @llvm.lifetime.start(i64 4, i8* %v7)
24 store i32 51, i32* %v3, align 4
25 %v8 = bitcast i32* %v4 to i8*
26 call void @llvm.lifetime.start(i64 4, i8* %v8)
27 store i32 875770417, i32* %v4, align 4
28 call void @test4(i8* %v5, i8* %v6, i8* %v7, i8* %v8)
29 call void @llvm.lifetime.end(i64 4, i8* %v8)
30 call void @llvm.lifetime.end(i64 4, i8* %v7)
31 call void @llvm.lifetime.end(i64 2, i8* %v6)
32 call void @llvm.lifetime.end(i64 1, i8* %v5)
37 ; CHECK-DAG: memw(r29+#208) = #51
38 ; CHECK-DAG: memh(r29+#212) = r{{[0-9]+}}
39 ; CHECK-DAG: memb(r29+#215) = r{{[0-9]+}}
40 define void @test2() {
42 %v1 = alloca [1 x i8], align 1
43 %v2 = alloca i16, align 2
44 %v3 = alloca i32, align 4
45 %v4 = alloca i32, align 4
46 %v5 = alloca [100 x i8], align 8
47 %v6 = alloca [101 x i8], align 8
48 %v7 = getelementptr inbounds [1 x i8], [1 x i8]* %v1, i32 0, i32 0
49 call void @llvm.lifetime.start(i64 1, i8* %v7)
50 store i8 49, i8* %v7, align 1
51 %v8 = bitcast i16* %v2 to i8*
52 call void @llvm.lifetime.start(i64 2, i8* %v8)
53 store i16 50, i16* %v2, align 2
54 %v9 = bitcast i32* %v3 to i8*
55 call void @llvm.lifetime.start(i64 4, i8* %v9)
56 store i32 51, i32* %v3, align 4
57 %v10 = bitcast i32* %v4 to i8*
58 call void @llvm.lifetime.start(i64 4, i8* %v10)
59 store i32 875770417, i32* %v4, align 4
60 %v11 = getelementptr inbounds [100 x i8], [100 x i8]* %v5, i32 0, i32 0
61 call void @llvm.lifetime.start(i64 100, i8* %v11)
62 call void @llvm.memset.p0i8.i32(i8* align 8 %v11, i8 0, i32 100, i1 false)
63 store i8 50, i8* %v11, align 8
64 %v12 = getelementptr inbounds [101 x i8], [101 x i8]* %v6, i32 0, i32 0
65 call void @llvm.lifetime.start(i64 101, i8* %v12)
66 call void @llvm.memset.p0i8.i32(i8* align 8 %v12, i8 0, i32 101, i1 false)
67 store i8 49, i8* %v12, align 8
68 call void @test3(i8* %v7, i8* %v8, i8* %v9, i8* %v10, i8* %v11, i8* %v12)
69 call void @llvm.lifetime.end(i64 101, i8* %v12)
70 call void @llvm.lifetime.end(i64 100, i8* %v11)
71 call void @llvm.lifetime.end(i64 4, i8* %v10)
72 call void @llvm.lifetime.end(i64 4, i8* %v9)
73 call void @llvm.lifetime.end(i64 2, i8* %v8)
74 call void @llvm.lifetime.end(i64 1, i8* %v7)
78 declare void @llvm.lifetime.start(i64, i8* nocapture) #0
79 declare void @llvm.lifetime.end(i64, i8* nocapture) #0
80 declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1) #0
82 declare void @test3(i8*, i8*, i8*, i8*, i8*, i8*)
83 declare void @test4(i8*, i8*, i8*, i8*)
85 attributes #0 = { argmemonly nounwind "target-cpu"="hexagonv60" }