1 ; RUN: llc %s -mtriple=aarch64 -o - | FileCheck %s
3 %struct.A = type { i8, i8, i8, i8, i8, i8, i8, i8, i32 }
5 ; The existence of the final i32 value should not prevent the i8s from
8 ; CHECK-LABEL: @merge_const_store
12 ; CHECK: str wzr, [x1, #8]
14 define void @merge_const_store(i32 %count, ptr nocapture %p) {
15 %1 = icmp sgt i32 %count, 0
16 br i1 %1, label %.lr.ph, label %._crit_edge
18 %i.02 = phi i32 [ %add, %.lr.ph ], [ 0, %0 ]
19 %.01 = phi ptr [ %addr, %.lr.ph ], [ %p, %0 ]
20 store i8 1, ptr %.01, align 1
21 %a3 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 1
22 store i8 2, ptr %a3, align 1
23 %a4 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 2
24 store i8 3, ptr %a4, align 1
25 %a5 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 3
26 store i8 4, ptr %a5, align 1
27 %a6 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 4
28 store i8 5, ptr %a6, align 1
29 %a7 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 5
30 store i8 6, ptr %a7, align 1
31 %a8 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 6
32 store i8 7, ptr %a8, align 1
33 %a9 = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 7
34 store i8 8, ptr %a9, align 1
37 %addr_last = getelementptr inbounds %struct.A, ptr %.01, i64 0, i32 8
38 store i32 0, ptr %addr_last, align 4
41 %add = add nsw i32 %i.02, 1
42 %addr = getelementptr inbounds %struct.A, ptr %.01, i64 1
43 %exitcond = icmp eq i32 %add, %count
44 br i1 %exitcond, label %._crit_edge, label %.lr.ph