1; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3; Ensure source scheduling is working
4
5define void @foo(i32* %a) {
6; CHECK: .func foo
7; CHECK: ld.u32
8; CHECK-NEXT: ld.u32
9; CHECK-NEXT: ld.u32
10; CHECK-NEXT: ld.u32
11; CHECK-NEXT: add.s32
12; CHECK-NEXT: add.s32
13; CHECK-NEXT: add.s32
14  %ptr0 = getelementptr i32, i32* %a, i32 0
15  %val0 = load i32, i32* %ptr0
16  %ptr1 = getelementptr i32, i32* %a, i32 1
17  %val1 = load i32, i32* %ptr1
18  %ptr2 = getelementptr i32, i32* %a, i32 2
19  %val2 = load i32, i32* %ptr2
20  %ptr3 = getelementptr i32, i32* %a, i32 3
21  %val3 = load i32, i32* %ptr3
22
23  %t0 = add i32 %val0, %val1
24  %t1 = add i32 %t0, %val2
25  %t2 = add i32 %t1, %val3
26
27  store i32 %t2, i32* %a
28
29  ret void
30}
31
32