1 ; RUN: opt -march=hexagon -hexagon-autohvx -passes=loop-vectorize -S < %s | FileCheck %s
2 ; Check that the loop is vectorized with VF=32.
3 ; CHECK: wide.load{{.*}} = load <32 x i32>
4 ; CHECK: wide.load{{.*}} = load <32 x i16>
6 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
7 target triple = "hexagon"
9 define dso_local void @example10a(ptr noalias nocapture %a0, ptr noalias nocapture readonly %a1, ptr noalias nocapture readonly %a2, ptr noalias nocapture %a3, ptr noalias nocapture readonly %a4, ptr noalias nocapture readonly %a5) local_unnamed_addr #0 {
13 b1: ; preds = %b1, %b0
14 %v0 = phi i32 [ 0, %b0 ], [ %v13, %b1 ]
15 %v1 = getelementptr inbounds i32, ptr %a4, i32 %v0
16 %v2 = load i32, ptr %v1, align 4, !tbaa !1
17 %v3 = getelementptr inbounds i32, ptr %a5, i32 %v0
18 %v4 = load i32, ptr %v3, align 4, !tbaa !1
19 %v5 = add nsw i32 %v4, %v2
20 %v6 = getelementptr inbounds i32, ptr %a3, i32 %v0
21 store i32 %v5, ptr %v6, align 4, !tbaa !1
22 %v7 = getelementptr inbounds i16, ptr %a1, i32 %v0
23 %v8 = load i16, ptr %v7, align 2, !tbaa !5
24 %v9 = getelementptr inbounds i16, ptr %a2, i32 %v0
25 %v10 = load i16, ptr %v9, align 2, !tbaa !5
26 %v11 = add i16 %v10, %v8
27 %v12 = getelementptr inbounds i16, ptr %a0, i32 %v0
28 store i16 %v11, ptr %v12, align 2, !tbaa !5
29 %v13 = add nuw nsw i32 %v0, 1
30 %v14 = icmp eq i32 %v13, 1024
31 br i1 %v14, label %b2, label %b1
37 attributes #0 = { noinline norecurse nounwind "target-cpu"="hexagonv60" "target-features"="+hvx-length64b,+hvxv60" }
39 !llvm.module.flags = !{!0}
41 !0 = !{i32 1, !"wchar_size", i32 4}
43 !2 = !{!"int", !3, i64 0}
44 !3 = !{!"omnipotent char", !4, i64 0}
45 !4 = !{!"Simple C++ TBAA"}
47 !6 = !{!"short", !3, i64 0}