Home | History | Annotate | Download | only in LoopUnroll
      1 ; RUN: opt < %s -S -loop-unroll -unroll-runtime | FileCheck %s
      2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
      3 target triple = "powerpc64-bgq-linux"
      4 
      5 define void @test1() nounwind {
      6 ; Ensure that we don't crash when the trip count == -1.
      7 ; CHECK-LABEL: @test1(
      8 entry:
      9   br label %for.cond2.preheader
     10 
     11 for.cond2.preheader:                              ; preds = %for.end, %entry
     12   br i1 false, label %middle.block, label %vector.ph
     13 
     14 vector.ph:                                        ; preds = %for.cond2.preheader
     15   br label %vector.body
     16 
     17 vector.body:                                      ; preds = %vector.body, %vector.ph
     18   br i1 undef, label %middle.block.loopexit, label %vector.body
     19 
     20 middle.block.loopexit:                            ; preds = %vector.body
     21   br label %middle.block
     22 
     23 middle.block:                                     ; preds = %middle.block.loopexit, %for.cond2.preheader
     24   br i1 true, label %for.end, label %scalar.preheader
     25 
     26 scalar.preheader:                                 ; preds = %middle.block
     27   br label %for.body4
     28 
     29 for.body4:                                        ; preds = %for.body4, %scalar.preheader
     30   %indvars.iv = phi i64 [ 16000, %scalar.preheader ], [ %indvars.iv.next, %for.body4 ]
     31   %indvars.iv.next = add i64 %indvars.iv, 1
     32   %lftr.wideiv = trunc i64 %indvars.iv.next to i32
     33   %exitcond = icmp ne i32 %lftr.wideiv, 16000
     34   br i1 %exitcond, label %for.body4, label %for.end.loopexit
     35 
     36 for.end.loopexit:                                 ; preds = %for.body4
     37   br label %for.end
     38 
     39 for.end:                                          ; preds = %for.end.loopexit, %middle.block
     40   br i1 undef, label %for.cond2.preheader, label %for.end15
     41 
     42 for.end15:                                        ; preds = %for.end
     43   ret void
     44 }
     45