Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon -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 
      5 target triple = "hexagon"
      6 
      7 ; Function Attrs: nounwind optsize readnone
      8 define void @dummy() #0 {
      9 entry:
     10   ret void
     11 }
     12 
     13 ; Function Attrs: nounwind optsize
     14 define void @conv3x3(i8* nocapture readonly %inp, i8* nocapture readonly %mask, i32 %shift, i8* nocapture %outp, i32 %width) #1 {
     15 entry:
     16   %cmp381 = icmp sgt i32 %width, 0
     17   %arrayidx16.gep = getelementptr i8, i8* %mask, i32 4
     18   %arrayidx19.gep = getelementptr i8, i8* %mask, i32 8
     19   br label %for.body
     20 
     21 for.body:                                         ; preds = %for.inc48, %entry
     22   %i.086 = phi i32 [ 0, %entry ], [ %inc49, %for.inc48 ]
     23   %mul = mul nsw i32 %i.086, %width
     24   %arrayidx.sum = add i32 %mul, %width
     25   br i1 %cmp381, label %for.cond5.preheader.lr.ph, label %for.inc48
     26 
     27 for.cond5.preheader.lr.ph:                        ; preds = %for.body
     28   %add.ptr.sum = add i32 %arrayidx.sum, %width
     29   %add.ptr1 = getelementptr inbounds i8, i8* %inp, i32 %add.ptr.sum
     30   %add.ptr = getelementptr inbounds i8, i8* %inp, i32 %arrayidx.sum
     31   %arrayidx = getelementptr inbounds i8, i8* %inp, i32 %mul
     32   %arrayidx44.gep = getelementptr i8, i8* %outp, i32 %mul
     33   br label %for.cond5.preheader
     34 
     35 for.cond5.preheader:                              ; preds = %if.end40, %for.cond5.preheader.lr.ph
     36   %arrayidx44.phi = phi i8* [ %arrayidx44.gep, %for.cond5.preheader.lr.ph ], [ %arrayidx44.inc, %if.end40 ]
     37   %j.085 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %inc46, %if.end40 ]
     38   %IN1.084 = phi i8* [ %arrayidx, %for.cond5.preheader.lr.ph ], [ %incdec.ptr, %if.end40 ]
     39   %IN2.083 = phi i8* [ %add.ptr, %for.cond5.preheader.lr.ph ], [ %incdec.ptr33, %if.end40 ]
     40   %IN3.082 = phi i8* [ %add.ptr1, %for.cond5.preheader.lr.ph ], [ %incdec.ptr34, %if.end40 ]
     41   br label %for.body7
     42 
     43 for.body7:                                        ; preds = %for.body7, %for.cond5.preheader
     44   %arrayidx8.phi = phi i8* [ %IN1.084, %for.cond5.preheader ], [ %arrayidx8.inc, %for.body7 ]
     45   %arrayidx9.phi = phi i8* [ %IN2.083, %for.cond5.preheader ], [ %arrayidx9.inc, %for.body7 ]
     46   %arrayidx11.phi = phi i8* [ %IN3.082, %for.cond5.preheader ], [ %arrayidx11.inc, %for.body7 ]
     47   %arrayidx13.phi = phi i8* [ %mask, %for.cond5.preheader ], [ %arrayidx13.inc, %for.body7 ]
     48   %arrayidx16.phi = phi i8* [ %arrayidx16.gep, %for.cond5.preheader ], [ %arrayidx16.inc, %for.body7 ]
     49   %arrayidx19.phi = phi i8* [ %arrayidx19.gep, %for.cond5.preheader ], [ %arrayidx19.inc, %for.body7 ]
     50   %k.080 = phi i32 [ 0, %for.cond5.preheader ], [ %inc, %for.body7 ]
     51   %sum.079 = phi i32 [ 0, %for.cond5.preheader ], [ %add32, %for.body7 ]
     52   %0 = load i8, i8* %arrayidx8.phi, align 1, !tbaa !1
     53   %1 = load i8, i8* %arrayidx9.phi, align 1, !tbaa !1
     54   %2 = load i8, i8* %arrayidx11.phi, align 1, !tbaa !1
     55   %3 = load i8, i8* %arrayidx13.phi, align 1, !tbaa !1
     56   %4 = load i8, i8* %arrayidx16.phi, align 1, !tbaa !1
     57   %5 = load i8, i8* %arrayidx19.phi, align 1, !tbaa !1
     58   %conv21 = zext i8 %0 to i32
     59   %conv22 = sext i8 %3 to i32
     60   %mul23 = mul nsw i32 %conv22, %conv21
     61   %conv24 = zext i8 %1 to i32
     62   %conv25 = sext i8 %4 to i32
     63   %mul26 = mul nsw i32 %conv25, %conv24
     64   %conv27 = zext i8 %2 to i32
     65   %conv28 = sext i8 %5 to i32
     66   %mul29 = mul nsw i32 %conv28, %conv27
     67   %add30 = add i32 %mul23, %sum.079
     68   %add31 = add i32 %add30, %mul26
     69   %add32 = add i32 %add31, %mul29
     70   %inc = add nsw i32 %k.080, 1
     71   %exitcond = icmp eq i32 %inc, 3
     72   %arrayidx8.inc = getelementptr i8, i8* %arrayidx8.phi, i32 1
     73   %arrayidx9.inc = getelementptr i8, i8* %arrayidx9.phi, i32 1
     74   %arrayidx11.inc = getelementptr i8, i8* %arrayidx11.phi, i32 1
     75   %arrayidx13.inc = getelementptr i8, i8* %arrayidx13.phi, i32 1
     76   %arrayidx16.inc = getelementptr i8, i8* %arrayidx16.phi, i32 1
     77   %arrayidx19.inc = getelementptr i8, i8* %arrayidx19.phi, i32 1
     78   br i1 %exitcond, label %for.end, label %for.body7
     79 
     80 for.end:                                          ; preds = %for.body7
     81   %incdec.ptr = getelementptr inbounds i8, i8* %IN1.084, i32 1
     82   %incdec.ptr33 = getelementptr inbounds i8, i8* %IN2.083, i32 1
     83   %incdec.ptr34 = getelementptr inbounds i8, i8* %IN3.082, i32 1
     84   %shr = ashr i32 %add32, %shift
     85   %cmp35 = icmp slt i32 %shr, 0
     86   br i1 %cmp35, label %if.end40, label %if.end
     87 
     88 if.end:                                           ; preds = %for.end
     89   %cmp37 = icmp sgt i32 %shr, 255
     90   br i1 %cmp37, label %if.then39, label %if.end40
     91 
     92 if.then39:                                        ; preds = %if.end
     93   br label %if.end40
     94 
     95 if.end40:                                         ; preds = %for.end, %if.then39, %if.end
     96   %sum.2 = phi i32 [ 255, %if.then39 ], [ %shr, %if.end ], [ 0, %for.end ]
     97   %conv41 = trunc i32 %sum.2 to i8
     98   store i8 %conv41, i8* %arrayidx44.phi, align 1, !tbaa !1
     99   %inc46 = add nsw i32 %j.085, 1
    100   %exitcond87 = icmp eq i32 %inc46, %width
    101   %arrayidx44.inc = getelementptr i8, i8* %arrayidx44.phi, i32 1
    102   br i1 %exitcond87, label %for.inc48.loopexit, label %for.cond5.preheader
    103 
    104 for.inc48.loopexit:                               ; preds = %if.end40
    105   br label %for.inc48
    106 
    107 for.inc48:                                        ; preds = %for.inc48.loopexit, %for.body
    108   %inc49 = add nsw i32 %i.086, 1
    109   %exitcond88 = icmp eq i32 %inc49, 2
    110   br i1 %exitcond88, label %for.end50, label %for.body
    111 
    112 for.end50:                                        ; preds = %for.inc48
    113   ret void
    114 }
    115 
    116 attributes #0 = { nounwind optsize readnone }
    117 attributes #1 = { nounwind optsize }
    118 
    119 !1 = !{!2, !2, i64 0}
    120 !2 = !{!"omnipotent char", !3, i64 0}
    121 !3 = !{!"Simple C/C++ TBAA"}
    122