40 lines · plain
1; REQUIRES: asserts2; RUN: opt < %s -force-vector-width=2 -force-vector-interleave=1 -passes=loop-vectorize -S --debug-only=loop-vectorize 2>&1 | FileCheck %s3 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"5target triple = "aarch64--linux-gnu"6 7%pair = type { i8, i8 }8 9; CHECK-LABEL: test10; CHECK: Found an estimated cost of 8 for VF 2 For instruction: {{.*}} load i811; CHECK: Found an estimated cost of 8 for VF 2 For instruction: {{.*}} load i812; CHECK-LABEL: entry:13; CHECK-LABEL: vector.body:14; CHECK: [[LOAD1:%.*]] = load i815; CHECK: [[LOAD2:%.*]] = load i816; CHECK: [[INSERT:%.*]] = insertelement <2 x i8> poison, i8 [[LOAD1]], i32 017; CHECK: insertelement <2 x i8> [[INSERT]], i8 [[LOAD2]], i32 118; CHECK: br i1 {{.*}}, label %middle.block, label %vector.body19 20define void @test(ptr %p, ptr %q, i64 %n) {21entry:22 br label %for.body23 24for.body:25 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]26 %tmp0 = getelementptr %pair, ptr %p, i64 %i, i32 027 %tmp1 = load i8, ptr %tmp0, align 128 %tmp2 = getelementptr %pair, ptr %p, i64 %i, i32 129 %tmp3 = load i8, ptr %tmp2, align 130 %add = add i8 %tmp1, %tmp331 %qi = getelementptr i8, ptr %q, i64 %i32 store i8 %add, ptr %qi, align 133 %i.next = add nuw nsw i64 %i, 134 %cond = icmp eq i64 %i.next, %n35 br i1 %cond, label %for.end, label %for.body36 37for.end:38 ret void39}40