1; RUN: llc -O2 < %s
2; Check for successful compilation. It originally caused an abort due to
3; the "isBarrier" flag set on instructions that were not meant to have it.
4
5target datalayout = "e-m:e-p:32:32-i1:32-i64:64-a:0-v32:32-n16:32"
6target triple = "hexagon"
7
8; Function Attrs: nounwind optsize readnone
9define void @dummy() #0 {
10entry:
11  ret void
12}
13
14; Function Attrs: nounwind optsize
15define void @conv3x3(i8* nocapture readonly %inp, i8* nocapture readonly %mask, i32 %shift, i8* nocapture %outp, i32 %width) #1 {
16entry:
17  %cmp381 = icmp sgt i32 %width, 0
18  %arrayidx16.gep = getelementptr i8, i8* %mask, i32 4
19  %arrayidx19.gep = getelementptr i8, i8* %mask, i32 8
20  br label %for.body
21
22for.body:                                         ; preds = %for.inc48, %entry
23  %i.086 = phi i32 [ 0, %entry ], [ %inc49, %for.inc48 ]
24  %mul = mul nsw i32 %i.086, %width
25  %arrayidx.sum = add i32 %mul, %width
26  br i1 %cmp381, label %for.cond5.preheader.lr.ph, label %for.inc48
27
28for.cond5.preheader.lr.ph:                        ; preds = %for.body
29  %add.ptr.sum = add i32 %arrayidx.sum, %width
30  %add.ptr1 = getelementptr inbounds i8, i8* %inp, i32 %add.ptr.sum
31  %add.ptr = getelementptr inbounds i8, i8* %inp, i32 %arrayidx.sum
32  %arrayidx = getelementptr inbounds i8, i8* %inp, i32 %mul
33  %arrayidx44.gep = getelementptr i8, i8* %outp, i32 %mul
34  br label %for.cond5.preheader
35
36for.cond5.preheader:                              ; preds = %if.end40, %for.cond5.preheader.lr.ph
37  %arrayidx44.phi = phi i8* [ %arrayidx44.gep, %for.cond5.preheader.lr.ph ], [ %arrayidx44.inc, %if.end40 ]
38  %j.085 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %inc46, %if.end40 ]
39  %IN1.084 = phi i8* [ %arrayidx, %for.cond5.preheader.lr.ph ], [ %incdec.ptr, %if.end40 ]
40  %IN2.083 = phi i8* [ %add.ptr, %for.cond5.preheader.lr.ph ], [ %incdec.ptr33, %if.end40 ]
41  %IN3.082 = phi i8* [ %add.ptr1, %for.cond5.preheader.lr.ph ], [ %incdec.ptr34, %if.end40 ]
42  br label %for.body7
43
44for.body7:                                        ; preds = %for.body7, %for.cond5.preheader
45  %arrayidx8.phi = phi i8* [ %IN1.084, %for.cond5.preheader ], [ %arrayidx8.inc, %for.body7 ]
46  %arrayidx9.phi = phi i8* [ %IN2.083, %for.cond5.preheader ], [ %arrayidx9.inc, %for.body7 ]
47  %arrayidx11.phi = phi i8* [ %IN3.082, %for.cond5.preheader ], [ %arrayidx11.inc, %for.body7 ]
48  %arrayidx13.phi = phi i8* [ %mask, %for.cond5.preheader ], [ %arrayidx13.inc, %for.body7 ]
49  %arrayidx16.phi = phi i8* [ %arrayidx16.gep, %for.cond5.preheader ], [ %arrayidx16.inc, %for.body7 ]
50  %arrayidx19.phi = phi i8* [ %arrayidx19.gep, %for.cond5.preheader ], [ %arrayidx19.inc, %for.body7 ]
51  %k.080 = phi i32 [ 0, %for.cond5.preheader ], [ %inc, %for.body7 ]
52  %sum.079 = phi i32 [ 0, %for.cond5.preheader ], [ %add32, %for.body7 ]
53  %0 = load i8, i8* %arrayidx8.phi, align 1, !tbaa !1
54  %1 = load i8, i8* %arrayidx9.phi, align 1, !tbaa !1
55  %2 = load i8, i8* %arrayidx11.phi, align 1, !tbaa !1
56  %3 = load i8, i8* %arrayidx13.phi, align 1, !tbaa !1
57  %4 = load i8, i8* %arrayidx16.phi, align 1, !tbaa !1
58  %5 = load i8, i8* %arrayidx19.phi, align 1, !tbaa !1
59  %conv21 = zext i8 %0 to i32
60  %conv22 = sext i8 %3 to i32
61  %mul23 = mul nsw i32 %conv22, %conv21
62  %conv24 = zext i8 %1 to i32
63  %conv25 = sext i8 %4 to i32
64  %mul26 = mul nsw i32 %conv25, %conv24
65  %conv27 = zext i8 %2 to i32
66  %conv28 = sext i8 %5 to i32
67  %mul29 = mul nsw i32 %conv28, %conv27
68  %add30 = add i32 %mul23, %sum.079
69  %add31 = add i32 %add30, %mul26
70  %add32 = add i32 %add31, %mul29
71  %inc = add nsw i32 %k.080, 1
72  %exitcond = icmp eq i32 %inc, 3
73  %arrayidx8.inc = getelementptr i8, i8* %arrayidx8.phi, i32 1
74  %arrayidx9.inc = getelementptr i8, i8* %arrayidx9.phi, i32 1
75  %arrayidx11.inc = getelementptr i8, i8* %arrayidx11.phi, i32 1
76  %arrayidx13.inc = getelementptr i8, i8* %arrayidx13.phi, i32 1
77  %arrayidx16.inc = getelementptr i8, i8* %arrayidx16.phi, i32 1
78  %arrayidx19.inc = getelementptr i8, i8* %arrayidx19.phi, i32 1
79  br i1 %exitcond, label %for.end, label %for.body7
80
81for.end:                                          ; preds = %for.body7
82  %incdec.ptr = getelementptr inbounds i8, i8* %IN1.084, i32 1
83  %incdec.ptr33 = getelementptr inbounds i8, i8* %IN2.083, i32 1
84  %incdec.ptr34 = getelementptr inbounds i8, i8* %IN3.082, i32 1
85  %shr = ashr i32 %add32, %shift
86  %cmp35 = icmp slt i32 %shr, 0
87  br i1 %cmp35, label %if.end40, label %if.end
88
89if.end:                                           ; preds = %for.end
90  %cmp37 = icmp sgt i32 %shr, 255
91  br i1 %cmp37, label %if.then39, label %if.end40
92
93if.then39:                                        ; preds = %if.end
94  br label %if.end40
95
96if.end40:                                         ; preds = %for.end, %if.then39, %if.end
97  %sum.2 = phi i32 [ 255, %if.then39 ], [ %shr, %if.end ], [ 0, %for.end ]
98  %conv41 = trunc i32 %sum.2 to i8
99  store i8 %conv41, i8* %arrayidx44.phi, align 1, !tbaa !1
100  %inc46 = add nsw i32 %j.085, 1
101  %exitcond87 = icmp eq i32 %inc46, %width
102  %arrayidx44.inc = getelementptr i8, i8* %arrayidx44.phi, i32 1
103  br i1 %exitcond87, label %for.inc48.loopexit, label %for.cond5.preheader
104
105for.inc48.loopexit:                               ; preds = %if.end40
106  br label %for.inc48
107
108for.inc48:                                        ; preds = %for.inc48.loopexit, %for.body
109  %inc49 = add nsw i32 %i.086, 1
110  %exitcond88 = icmp eq i32 %inc49, 2
111  br i1 %exitcond88, label %for.end50, label %for.body
112
113for.end50:                                        ; preds = %for.inc48
114  ret void
115}
116
117attributes #0 = { nounwind optsize readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
118attributes #1 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
119
120!llvm.ident = !{!0}
121
122!0 = !{!"Clang 3.1"}
123!1 = !{!2, !2, i64 0}
124!2 = !{!"omnipotent char", !3, i64 0}
125!3 = !{!"Simple C/C++ TBAA"}
126