Home | History | Annotate | Download | only in LoopVectorize
      1 ; RUN: opt -loop-vectorize -force-vector-width=2 -force-vector-unroll=1 -S < %s | FileCheck %s
      2 @a = common global [128 x i32] zeroinitializer, align 16
      3 
      4 ;; Must not vectorize division reduction. Division is lossy.
      5 define i32 @g() {
      6 entry:
      7   br label %for.body
      8 
      9 for.body:
     10   ; CHECK-LABEL: @g(
     11   ; CHECK-NOT: sdiv <2 x i32>
     12   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
     13   %r.05 = phi i32 [ 80, %entry ], [ %div, %for.body ]
     14   %arrayidx = getelementptr inbounds [128 x i32]* @a, i64 0, i64 %indvars.iv
     15   %0 = load i32* %arrayidx, align 4
     16   %div = sdiv i32 %r.05, %0
     17   %indvars.iv.next = add i64 %indvars.iv, 1
     18   %lftr.wideiv = trunc i64 %indvars.iv.next to i32
     19   %exitcond = icmp eq i32 %lftr.wideiv, 1024
     20   br i1 %exitcond, label %for.end, label %for.body
     21 
     22 for.end:
     23   ret i32 %div
     24 }
     25