1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=CHECK
4 ; This tests for a cyclic dependencies in the generated DAG.
6 @c = external dso_local local_unnamed_addr global i32, align 4
7 @a = external dso_local local_unnamed_addr global i32, align 4
8 @b = external dso_local local_unnamed_addr global i32, align 4
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
14 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
15 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
16 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
17 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
18 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
19 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
20 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
21 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
22 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
23 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
24 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
25 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
26 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
27 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
28 ; CHECK-NEXT: movl $0, b(%rip)
29 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %esi
30 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %edi
31 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %r8d
32 ; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %eax
34 ; CHECK-NEXT: idivl a(%rip)
35 ; CHECK-NEXT: movl %eax, %ecx
36 ; CHECK-NEXT: movl c(%rip), %eax
38 ; CHECK-NEXT: idivl %r8d
39 ; CHECK-NEXT: andl %edi, %eax
40 ; CHECK-NEXT: addl %ecx, %eax
41 ; CHECK-NEXT: andl %esi, %eax
42 ; CHECK-NEXT: movl %eax, (%rax)
45 %e = alloca i32, align 4
46 %e.0.e.0.24 = load volatile i32, ptr %e, align 4
47 %e.0.e.0.25 = load volatile i32, ptr %e, align 4
48 %e.0.e.0.26 = load volatile i32, ptr %e, align 4
49 %e.0.e.0.27 = load volatile i32, ptr %e, align 4
50 %e.0.e.0.28 = load volatile i32, ptr %e, align 4
51 %e.0.e.0.29 = load volatile i32, ptr %e, align 4
52 %e.0.e.0.30 = load volatile i32, ptr %e, align 4
53 %e.0.e.0.31 = load volatile i32, ptr %e, align 4
54 %e.0.e.0.32 = load volatile i32, ptr %e, align 4
55 %e.0.e.0.33 = load volatile i32, ptr %e, align 4
56 %e.0.e.0.34 = load volatile i32, ptr %e, align 4
57 %e.0.e.0.35 = load volatile i32, ptr %e, align 4
58 %e.0.e.0.36 = load volatile i32, ptr %e, align 4
59 %e.0.e.0.37 = load volatile i32, ptr %e, align 4
60 %e.0.e.0.39 = load volatile i32, ptr %e, align 4
61 %tmp = load i32, ptr @a, align 4
62 store i32 0, ptr @b, align 4
63 %e.0.e.0.41 = load volatile i32, ptr %e, align 4
64 %add17 = add nsw i32 %e.0.e.0.41, 0
65 %e.0.e.0.42 = load volatile i32, ptr %e, align 4
66 %tmp1 = load i32, ptr @c, align 4
67 %e.0.e.0.43 = load volatile i32, ptr %e, align 4
68 %div = sdiv i32 %tmp1, %e.0.e.0.43
69 %and18 = and i32 %div, %e.0.e.0.42
70 %e.0.e.0.44 = load volatile i32, ptr %e, align 4
71 %div19 = sdiv i32 %e.0.e.0.44, %tmp
72 %add20 = add nsw i32 %div19, %and18
73 %and21 = and i32 %add20, %add17
74 store volatile i32 %and21, ptr undef, align 4