blob: f98963d8e90eb827e2c00d874e6eaff2eafcb1b9 [file] [log] [blame]
Juergen Ributzka3db39dc2013-08-21 21:53:38 +00001; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 | FileCheck %s
Hal Finkelc3998302014-04-12 00:59:48 +00002; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -addr-sink-using-gep=1 | FileCheck %s
Juergen Ributzka3db39dc2013-08-21 21:53:38 +00003
4define void @merge_store(i32* nocapture %a) {
5; CHECK-LABEL: merge_store:
6; CHECK: movq
7; CHECK: movq
8entry:
9 br label %for.body
10
11 for.body:
12 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
13 %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv
14 store i32 1, i32* %arrayidx, align 4
15 %0 = or i64 %indvars.iv, 1
16 %arrayidx2 = getelementptr inbounds i32* %a, i64 %0
17 store i32 1, i32* %arrayidx2, align 4
18 %1 = or i64 %indvars.iv, 2
19 %arrayidx5 = getelementptr inbounds i32* %a, i64 %1
20 store i32 1, i32* %arrayidx5, align 4
21 %2 = or i64 %indvars.iv, 3
22 %arrayidx8 = getelementptr inbounds i32* %a, i64 %2
23 store i32 1, i32* %arrayidx8, align 4
24 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 4
25 %3 = trunc i64 %indvars.iv.next to i32
26 %cmp = icmp slt i32 %3, 1000
27 br i1 %cmp, label %for.body, label %for.end
28
29 for.end:
30 ret void
31}