blob: bb55d2ac9b1faee239ee3ed70843ab3ca3b81c4b [file] [log] [blame]
Justin Lebarc75d5662016-02-19 00:18:46 +00001; RUN: llc -stop-after block-placement -o /dev/null %s 2>&1 | FileCheck %s
Scott Douglass290183d2015-10-01 11:56:19 +00002
3target triple = "thumbv6m-none-none"
4
5define i32* @foo(i32* readonly %p0) {
6entry:
7 %add.ptr = getelementptr inbounds i32, i32* %p0, i32 10
8 %arrayidx = getelementptr inbounds i32, i32* %p0, i32 13
9 %0 = load i32, i32* %arrayidx, align 4
10 %arrayidx1 = getelementptr inbounds i32, i32* %p0, i32 12
11 %1 = load i32, i32* %arrayidx1, align 4
12 %add = add nsw i32 %1, %0
13 %arrayidx2 = getelementptr inbounds i32, i32* %p0, i32 11
14 %2 = load i32, i32* %arrayidx2, align 4
15 %add3 = add nsw i32 %add, %2
16 %3 = load i32, i32* %add.ptr, align 4
17 %add5 = add nsw i32 %add3, %3
18 tail call void @g(i32 %add5)
19 ret i32* %p0
20}
21
22declare void @g(i32)
23
24; CHECK-LABEL: name: foo
25; CHECK: [[BASE:%r[0-7]]], {{.*}} tADDi8
26; CHECK-NOT: [[BASE]] = tLDMIA_UPD {{.*}} [[BASE]]
27; CHECK: tLDMIA killed [[BASE]], {{.*}} def [[BASE]]