Home | History | Annotate | Download | only in LoopVectorize
      1 ; RUN: opt < %s  -loop-vectorize -dce -force-vector-unroll=1 -force-vector-width=4 
      2 
      3 ; Check that we don't crash.
      4 
      5 target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
      6 target triple = "x86_64-unknown-linux-gnu"
      7 
      8 module asm "\09.ident\09\22GCC: (GNU) 4.6.3 LLVM: 3.2svn\22"
      9 
     10 @b = common global [32000 x float] zeroinitializer, align 16
     11 
     12 define i32 @set1ds(i32 %_n, float* nocapture %arr, float %value, i32 %stride) nounwind uwtable {
     13 entry:
     14   %0 = icmp sgt i32 %_n, 0
     15   br i1 %0, label %"3.lr.ph", label %"5"
     16 
     17 "3.lr.ph":                                        ; preds = %entry
     18   %1 = bitcast float* %arr to i8*
     19   %2 = sext i32 %stride to i64
     20   br label %"3"
     21 
     22 "3":                                              ; preds = %"3.lr.ph", %"3"
     23   %indvars.iv = phi i64 [ 0, %"3.lr.ph" ], [ %indvars.iv.next, %"3" ]
     24   %3 = shl nsw i64 %indvars.iv, 2
     25   %4 = getelementptr inbounds i8* %1, i64 %3
     26   %5 = bitcast i8* %4 to float*
     27   store float %value, float* %5, align 4
     28   %indvars.iv.next = add i64 %indvars.iv, %2
     29   %6 = trunc i64 %indvars.iv.next to i32
     30   %7 = icmp slt i32 %6, %_n
     31   br i1 %7, label %"3", label %"5"
     32 
     33 "5":                                              ; preds = %"3", %entry
     34   ret i32 0
     35 }
     36 
     37 define i32 @init(i8* nocapture %name) unnamed_addr nounwind uwtable {
     38 entry:
     39   br label %"3"
     40 
     41 "3":                                              ; preds = %"3", %entry
     42   %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %"3" ]
     43   %0 = shl nsw i64 %indvars.iv, 2
     44   %1 = getelementptr inbounds i8* bitcast (float* getelementptr inbounds ([32000 x float]* @b, i64 0, i64 16000) to i8*), i64 %0
     45   %2 = bitcast i8* %1 to float*
     46   store float -1.000000e+00, float* %2, align 4
     47   %indvars.iv.next = add i64 %indvars.iv, 1
     48   %lftr.wideiv = trunc i64 %indvars.iv.next to i32
     49   %exitcond = icmp eq i32 %lftr.wideiv, 16000
     50   br i1 %exitcond, label %"5", label %"3"
     51 
     52 "5":                                              ; preds = %"3"
     53   ret i32 0
     54 }
     55