xref: /llvm-project/polly/test/CodeGen/loop-invariant-load-type-mismatch.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly -passes=polly-codegen < %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
6; Just make sure this test passes correctly.
7
8define void @kernel_ludcmp(ptr %b, ptr %y) #0 {
9entry:
10  br label %entry.split
11
12entry.split:                                      ; preds = %entry
13  br label %for.body
14
15for.cond.30.for.cond.loopexit_crit_edge:          ; preds = %for.end.54
16  br label %for.cond.loopexit
17
18for.cond.loopexit:                                ; preds = %for.cond.30.preheader, %for.cond.30.for.cond.loopexit_crit_edge
19  %indvars.iv.next131 = add nuw nsw i32 %indvars.iv130, 1
20  br i1 false, label %for.body, label %for.end.65
21
22for.body:                                         ; preds = %for.cond.loopexit, %entry.split
23  %indvars.iv130 = phi i32 [ 1, %entry.split ], [ %indvars.iv.next131, %for.cond.loopexit ]
24  br i1 true, label %for.body.3.lr.ph, label %for.cond.30.preheader
25
26for.body.3.lr.ph:                                 ; preds = %for.body
27  br label %for.body.3
28
29for.cond.1.for.cond.30.preheader_crit_edge:       ; preds = %for.end
30  br label %for.cond.30.preheader
31
32for.cond.30.preheader:                            ; preds = %for.cond.1.for.cond.30.preheader_crit_edge, %for.body
33  br i1 true, label %for.body.32.lr.ph, label %for.cond.loopexit
34
35for.body.32.lr.ph:                                ; preds = %for.cond.30.preheader
36  br label %for.body.32
37
38for.body.3:                                       ; preds = %for.end, %for.body.3.lr.ph
39  br i1 false, label %for.body.9.lr.ph, label %for.end
40
41for.body.9.lr.ph:                                 ; preds = %for.body.3
42  br label %for.body.9
43
44for.body.9:                                       ; preds = %for.body.9, %for.body.9.lr.ph
45  br i1 false, label %for.body.9, label %for.cond.7.for.end_crit_edge
46
47for.cond.7.for.end_crit_edge:                     ; preds = %for.body.9
48  br label %for.end
49
50for.end:                                          ; preds = %for.cond.7.for.end_crit_edge, %for.body.3
51  br i1 false, label %for.body.3, label %for.cond.1.for.cond.30.preheader_crit_edge
52
53for.body.32:                                      ; preds = %for.end.54, %for.body.32.lr.ph
54  %indvars.iv136 = phi i64 [ 0, %for.body.32.lr.ph ], [ %indvars.iv.next137, %for.end.54 ]
55  br i1 false, label %for.end.54, label %for.body.40.lr.ph
56
57for.body.40.lr.ph:                                ; preds = %for.body.32
58  br label %for.body.40
59
60for.body.40:                                      ; preds = %for.body.40, %for.body.40.lr.ph
61  %indvars.iv.next129 = add nuw nsw i64 0, 1
62  %lftr.wideiv132 = trunc i64 %indvars.iv.next129 to i32
63  br i1 false, label %for.body.40, label %for.cond.38.for.end.54_crit_edge
64
65for.cond.38.for.end.54_crit_edge:                 ; preds = %for.body.40
66  br label %for.end.54
67
68for.end.54:                                       ; preds = %for.cond.38.for.end.54_crit_edge, %for.body.32
69  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
70  %lftr.wideiv138 = trunc i64 %indvars.iv.next137 to i32
71  br i1 false, label %for.body.32, label %for.cond.30.for.cond.loopexit_crit_edge
72
73for.end.65:                                       ; preds = %for.cond.loopexit
74  %tmp2 = load i64, ptr %b, align 8, !tbaa !1
75  store i64 %tmp2, ptr %y, align 8, !tbaa !1
76  br label %for.body.70
77
78for.body.70:                                      ; preds = %for.end.86, %for.end.65
79  %tmp4 = load double, ptr %b, align 8, !tbaa !1
80  br i1 true, label %for.body.75.lr.ph, label %for.end.86
81
82for.body.75.lr.ph:                                ; preds = %for.body.70
83  br label %for.body.75
84
85for.body.75:                                      ; preds = %for.body.75, %for.body.75.lr.ph
86  %w.284 = phi double [ %tmp4, %for.body.75.lr.ph ], [ %sub83, %for.body.75 ]
87  %sub83 = fsub double %w.284, undef
88  br i1 false, label %for.body.75, label %for.cond.73.for.end.86_crit_edge
89
90for.cond.73.for.end.86_crit_edge:                 ; preds = %for.body.75
91  br label %for.end.86
92
93for.end.86:                                       ; preds = %for.cond.73.for.end.86_crit_edge, %for.body.70
94  br i1 false, label %for.body.70, label %for.end.91
95
96for.end.91:                                       ; preds = %for.end.86
97  br label %for.body.99
98
99for.body.99:                                      ; preds = %for.end.118, %for.end.91
100  br i1 true, label %for.body.106.lr.ph, label %for.end.118
101
102for.body.106.lr.ph:                               ; preds = %for.body.99
103  br label %for.body.106
104
105for.body.106:                                     ; preds = %for.body.106, %for.body.106.lr.ph
106  br i1 undef, label %for.body.106, label %for.cond.104.for.end.118_crit_edge
107
108for.cond.104.for.end.118_crit_edge:               ; preds = %for.body.106
109  br label %for.end.118
110
111for.end.118:                                      ; preds = %for.cond.104.for.end.118_crit_edge, %for.body.99
112  br i1 undef, label %for.body.99, label %for.end.131
113
114for.end.131:                                      ; preds = %for.end.118
115  ret void
116}
117
118attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
119
120!llvm.ident = !{!0}
121
122!0 = !{!"clang version 3.8.0 (trunk 250010) (llvm/trunk 250018)"}
123!1 = !{!2, !2, i64 0}
124!2 = !{!"double", !3, i64 0}
125!3 = !{!"omnipotent char", !4, i64 0}
126!4 = !{!"Simple C/C++ TBAA"}
127