2 ; RUN: opt < %s -force-vector-width=2 -force-vector-interleave=1 -loop-vectorize -S --debug-only=loop-vectorize 2>&1 | FileCheck %s
4 ; This test shows extremely high interleaving cost that, probably, should be fixed.
5 ; Due to the high cost, interleaving is not beneficial and the cost model chooses to scalarize
6 ; the load instructions.
8 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
9 target triple = "aarch64--linux-gnu"
11 %pair = type { i8, i8 }
14 ; CHECK: Found an estimated cost of 20 for VF 2 For instruction: {{.*}} load i8
15 ; CHECK: Found an estimated cost of 0 for VF 2 For instruction: {{.*}} load i8
18 ; CHECK: br i1 {{.*}}, label %middle.block, label %vector.body
20 define void @test(%pair* %p, i64 %n) {
25 %i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
26 %tmp0 = getelementptr %pair, %pair* %p, i64 %i, i32 0
27 %tmp1 = load i8, i8* %tmp0, align 1
28 %tmp2 = getelementptr %pair, %pair* %p, i64 %i, i32 1
29 %tmp3 = load i8, i8* %tmp2, align 1
30 %i.next = add nuw nsw i64 %i, 1
31 %cond = icmp eq i64 %i.next, %n
32 br i1 %cond, label %for.end, label %for.body