brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · d5528e7 Raw
53 lines · plain
1; RUN: opt -S -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 < %s 2>&1 | FileCheck %s2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"4@b = common local_unnamed_addr global i8 0, align 15 6define void @doit1(ptr %ptr) {7; CHECK-LABEL: @doit1(8; CHECK:       vector.body:9; CHECK-NEXT:    [[MAIN_IV:%.*]] = phi i32 [ 0, [[VECTOR_PH:%.*]] ], [ [[MAIN_IV_NEXT:%.*]], [[VECTOR_BODY:%.*]] ]10; CHECK-NEXT:    [[I8_IV:%.*]] = phi <4 x i8> [ zeroinitializer, [[VECTOR_PH]] ], [ [[I8_IV_NEXT:%.*]], [[VECTOR_BODY]] ]11; CHECK-NEXT:    [[I32_IV:%.*]] = phi <4 x i32> [ <i32 0, i32 9, i32 18, i32 27>, [[VECTOR_PH]] ], [ [[I32_IV_NEXT:%.*]], [[VECTOR_BODY]] ]12; CHECK-NEXT:    [[IV_FROM_TRUNC:%.*]] = phi <4 x i8> [ <i8 0, i8 9, i8 18, i8 27>, [[VECTOR_PH]] ], [ [[IV_FROM_TRUNC_NEXT:%.*]], [[VECTOR_BODY]] ]13 14; CHECK-NEXT:    [[I8_IV_NEXT]] = add <4 x i8> [[I8_IV]], [[IV_FROM_TRUNC]]15 16; CHECK-NEXT:    [[GEP1:%.+]] = getelementptr inbounds i32, ptr %ptr, i32 [[MAIN_IV]]17; CHECK-NEXT:    store <4 x i32> [[I32_IV]], ptr [[GEP1]], align 418 19; CHECK-NEXT:    [[MAIN_IV_NEXT]] = add nuw i32 [[MAIN_IV]], 420; CHECK-NEXT:    [[I32_IV_NEXT]] = add nuw nsw <4 x i32> [[I32_IV]], splat (i32 36)21; CHECK-NEXT:    [[IV_FROM_TRUNC_NEXT]] = add <4 x i8> [[IV_FROM_TRUNC]], splat (i8 36)22; CHECK-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[MAIN_IV_NEXT]], 1623; CHECK-NEXT:    br i1 [[TMP9]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop !024;25entry:26  br label %for.body27 28for.body:29  %main.iv = phi i32 [ 0, %entry ], [ %inc, %for.body ]30 31  %i8.iv = phi i8 [ 0, %entry ], [ %i8.add, %for.body ]32  %i32.iv = phi i32 [ 0, %entry ], [ %i32.add, %for.body ]33 34  %trunc.to.be.converted.to.new.iv = trunc i32 %i32.iv to i835  %i8.add = add i8 %i8.iv, %trunc.to.be.converted.to.new.iv36 37  %ptr.gep = getelementptr inbounds i32, ptr %ptr, i32 %main.iv38  store i32 %i32.iv, ptr %ptr.gep39  %noop.conv.under.pse = and i32 %i32.iv, 25540  %i32.add = add nuw nsw i32 %noop.conv.under.pse, 941 42  %inc = add i32 %main.iv, 143  %tobool = icmp eq i32 %inc, 1644  br i1 %tobool, label %for.cond.for.end_crit_edge, label %for.body45 46for.cond.for.end_crit_edge:47  store i8 %i8.add, ptr @b, align 148  br label %for.end49 50for.end:51  ret void52}53