brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 8428ead Raw
82 lines · plain
1; REQUIRES: asserts2; RUN: opt -passes=loop-vectorize -S -mattr=avx512f --debug-only=loop-vectorize --disable-output < %s 2>&1| FileCheck %s3 4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-unknown-linux-gnu"6 7@A = global [10240 x i64] zeroinitializer, align 168@B = global [10240 x i64] zeroinitializer, align 169 10; Function Attrs: nounwind uwtable11define void @load_i64_stride2() {12;CHECK-LABEL: load_i64_stride213;CHECK: Found an estimated cost of 1 for VF 1 For instruction:   %1 = load14;CHECK: Found an estimated cost of 1 for VF 2 For instruction:   %1 = load15;CHECK: Found an estimated cost of 1 for VF 4 For instruction:   %1 = load16;CHECK: Found an estimated cost of 2 for VF 8 For instruction:   %1 = load17entry:18  br label %for.body19 20for.body:                                         ; preds = %for.body, %entry21  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]22  %0 = shl nsw i64 %indvars.iv, 123  %arrayidx = getelementptr inbounds [10240 x i64], ptr @A, i64 0, i64 %024  %1 = load i64, ptr %arrayidx, align 1625  %arrayidx2 = getelementptr inbounds [10240 x i64], ptr @B, i64 0, i64 %indvars.iv26  store i64 %1, ptr %arrayidx2, align 827  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 128  %exitcond = icmp eq i64 %indvars.iv.next, 102429  br i1 %exitcond, label %for.end, label %for.body30 31for.end:                                          ; preds = %for.body32  ret void33}34 35define void @load_i64_stride3() {36;CHECK-LABEL: load_i64_stride337;CHECK: Found an estimated cost of 1 for VF 1 For instruction:   %1 = load38;CHECK: Found an estimated cost of 1 for VF 2 For instruction:   %1 = load39;CHECK: Found an estimated cost of 2 for VF 4 For instruction:   %1 = load40;CHECK: Found an estimated cost of 3 for VF 8 For instruction:   %1 = load41entry:42  br label %for.body43 44for.body:                                         ; preds = %for.body, %entry45  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]46  %0 = mul nsw i64 %indvars.iv, 347  %arrayidx = getelementptr inbounds [10240 x i64], ptr @A, i64 0, i64 %048  %1 = load i64, ptr %arrayidx, align 1649  %arrayidx2 = getelementptr inbounds [10240 x i64], ptr @B, i64 0, i64 %indvars.iv50  store i64 %1, ptr %arrayidx2, align 851  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 152  %exitcond = icmp eq i64 %indvars.iv.next, 102453  br i1 %exitcond, label %for.end, label %for.body54 55for.end:                                          ; preds = %for.body56  ret void57}58 59define void @load_i64_stride4() {60;CHECK-LABEL: load_i64_stride461;CHECK: Found an estimated cost of 1 for VF 1 For instruction:   %1 = load62;CHECK: Found an estimated cost of 1 for VF 2 For instruction:   %1 = load63;CHECK: Found an estimated cost of 2 for VF 4 For instruction:   %1 = load64;CHECK: Found an estimated cost of 5 for VF 8 For instruction:   %1 = load65entry:66  br label %for.body67 68for.body:                                         ; preds = %for.body, %entry69  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]70  %0 = mul nsw i64 %indvars.iv, 471  %arrayidx = getelementptr inbounds [10240 x i64], ptr @A, i64 0, i64 %072  %1 = load i64, ptr %arrayidx, align 1673  %arrayidx2 = getelementptr inbounds [10240 x i64], ptr @B, i64 0, i64 %indvars.iv74  store i64 %1, ptr %arrayidx2, align 875  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 176  %exitcond = icmp eq i64 %indvars.iv.next, 102477  br i1 %exitcond, label %for.end, label %for.body78 79for.end:                                          ; preds = %for.body80  ret void81}82