1 ; RUN: llc < %s -mtriple=arm64-linux-gnu -mcpu=cortex-a53 -enable-aa-sched-mi | FileCheck %s
2 ; Check that the scheduler moves the load from a[1] past the store into a[2].
3 @a = common global ptr null, align 8
4 @m = common global i32 0, align 4
6 ; Function Attrs: nounwind
7 define i32 @func(i32 %i, i32 %j, i32 %k) #0 {
9 ; CHECK: ldr {{w[0-9]+}}, [x[[REG:[0-9]+]], #4]
10 ; CHECK: str {{w[0-9]+}}, [x[[REG]], #8]
11 %0 = load ptr, ptr @a, align 8, !tbaa !1
12 %arrayidx = getelementptr inbounds i32, ptr %0, i64 2
13 store i32 %i, ptr %arrayidx, align 4, !tbaa !5
14 %arrayidx1 = getelementptr inbounds i32, ptr %0, i64 1
15 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
16 %add = add nsw i32 %k, %i
17 store i32 %add, ptr @m, align 4, !tbaa !5
21 attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
25 !0 = !{!"clang version 3.6.0 "}
27 !2 = !{!"any pointer", !3, i64 0}
28 !3 = !{!"omnipotent char", !4, i64 0}
29 !4 = !{!"Simple C/C++ TBAA"}
31 !6 = !{!"int", !3, i64 0}