brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 5705ee3 Raw
58 lines · plain
1; RUN: opt < %s -passes=loop-vectorize,dce,instcombine -force-vector-interleave=1 -force-vector-width=4 -S | FileCheck %s2 3target 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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"4 5@a = common global [2048 x i32] zeroinitializer, align 166@b = common global [2048 x i32] zeroinitializer, align 167@c = common global [2048 x i32] zeroinitializer, align 168 9;CHECK-LABEL: @example1(10;CHECK: load <4 x i32>11;CHECK: ret void12define void @example1() nounwind uwtable ssp {13  br label %114 15; <label>:1                                       ; preds = %1, %016  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ]17  %2 = getelementptr inbounds [2048 x i32], ptr @b, i64 0, i64 %indvars.iv18  %3 = load i32, ptr %2, align 419  %4 = getelementptr inbounds [2048 x i32], ptr @c, i64 0, i64 %indvars.iv20  %5 = load i32, ptr %4, align 421  %6 = add nsw i32 %5, %322  %7 = getelementptr inbounds [2048 x i32], ptr @a, i64 0, i64 %indvars.iv23  store i32 %6, ptr %7, align 424  %indvars.iv.next = add i64 %indvars.iv, 125  %lftr.wideiv = trunc i64 %indvars.iv.next to i3226  %exitcond = icmp eq i32 %lftr.wideiv, 8  ;   <-----  A really small trip count27  br i1 %exitcond, label %8, label %1      ;           w/o scalar iteration overhead.28 29; <label>:8                                       ; preds = %130  ret void31}32 33;CHECK-LABEL: @bound1(34;CHECK-NOT: load <4 x i32>35;CHECK: ret void36define void @bound1(i32 %k) nounwind uwtable ssp {37  br label %138 39; <label>:1                                       ; preds = %1, %040  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ]41  %2 = getelementptr inbounds [2048 x i32], ptr @b, i64 0, i64 %indvars.iv42  %3 = load i32, ptr %2, align 443  %4 = getelementptr inbounds [2048 x i32], ptr @c, i64 0, i64 %indvars.iv44  %5 = load i32, ptr %4, align 445  %6 = add nsw i32 %5, %346  %7 = getelementptr inbounds [2048 x i32], ptr @a, i64 0, i64 %indvars.iv47  store i32 %6, ptr %7, align 448  %indvars.iv.next = add i64 %indvars.iv, 149  %lftr.wideiv = trunc i64 %indvars.iv.next to i3250  %large = icmp sge i32 %lftr.wideiv, 851  %exitcond = icmp eq i32 %lftr.wideiv, %k52  %realexit = or i1 %large, %exitcond53  br i1 %realexit, label %8, label %154 55; <label>:8                                       ; preds = %156  ret void57}58