1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 %struct.node = type { i64, i64, ptr, ptr }
9 define void @copy(ptr nocapture noundef writeonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) {
12 ; CHECK-NEXT: [[CMP34:%.*]] = icmp sgt i32 [[N:%.*]], 0
13 ; CHECK-NEXT: br i1 [[CMP34]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
14 ; CHECK: for.body.preheader:
15 ; CHECK-NEXT: [[WIDE_TRIP_COUNT:%.*]] = zext i32 [[N]] to i64
16 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
17 ; CHECK: for.cond.cleanup:
18 ; CHECK-NEXT: ret void
20 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[FOR_BODY_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
21 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_NODE:%.*]], ptr [[Y:%.*]], i64 [[INDVARS_IV]]
22 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [[STRUCT_NODE]], ptr [[X:%.*]], i64 [[INDVARS_IV]]
23 ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, ptr [[ARRAYIDX]], align 8, !tbaa [[TBAA0:![0-9]+]]
24 ; CHECK-NEXT: store <2 x i64> [[TMP0]], ptr [[ARRAYIDX2]], align 8, !tbaa [[TBAA0]]
25 ; CHECK-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT_NODE]], ptr [[Y]], i64 [[INDVARS_IV]], i32 2
26 ; CHECK-NEXT: [[C13:%.*]] = getelementptr inbounds [[STRUCT_NODE]], ptr [[X]], i64 [[INDVARS_IV]], i32 2
27 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x ptr>, ptr [[C]], align 8, !tbaa [[TBAA4:![0-9]+]]
28 ; CHECK-NEXT: store <2 x ptr> [[TMP1]], ptr [[C13]], align 8, !tbaa [[TBAA4]]
29 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
30 ; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
31 ; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY]]
34 %cmp34 = icmp sgt i32 %n, 0
35 br i1 %cmp34, label %for.body.preheader, label %for.cond.cleanup
38 %wide.trip.count = zext i32 %n to i64
45 %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
46 %arrayidx = getelementptr inbounds %struct.node, ptr %y, i64 %indvars.iv
47 %0 = load i64, ptr %arrayidx, align 8, !tbaa !4
48 %arrayidx2 = getelementptr inbounds %struct.node, ptr %x, i64 %indvars.iv
49 store i64 %0, ptr %arrayidx2, align 8, !tbaa !4
50 %b = getelementptr inbounds %struct.node, ptr %y, i64 %indvars.iv, i32 1
51 %1 = load i64, ptr %b, align 8, !tbaa !10
52 %b8 = getelementptr inbounds %struct.node, ptr %x, i64 %indvars.iv, i32 1
53 store i64 %1, ptr %b8, align 8, !tbaa !10
54 %c = getelementptr inbounds %struct.node, ptr %y, i64 %indvars.iv, i32 2
55 %2 = load ptr, ptr %c, align 8, !tbaa !11
56 %c13 = getelementptr inbounds %struct.node, ptr %x, i64 %indvars.iv, i32 2
57 store ptr %2, ptr %c13, align 8, !tbaa !11
58 %d = getelementptr inbounds %struct.node, ptr %y, i64 %indvars.iv, i32 3
59 %3 = load ptr, ptr %d, align 8, !tbaa !12
60 %d18 = getelementptr inbounds %struct.node, ptr %x, i64 %indvars.iv, i32 3
61 store ptr %3, ptr %d18, align 8, !tbaa !12
62 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
63 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
64 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
68 !5 = !{!"", !6, i64 0, !6, i64 8, !9, i64 16, !9, i64 24}
69 !6 = !{!"long", !7, i64 0}
70 !7 = !{!"omnipotent char", !8, i64 0}
71 !8 = !{!"Simple C/C++ TBAA"}
72 !9 = !{!"any pointer", !7, i64 0}
73 !10 = !{!5, !6, i64 8}
74 !11 = !{!5, !9, i64 16}
75 !12 = !{!5, !9, i64 24}