1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -mtriple=x86_64-pc-linux-gnu -mcpu=generic -slp-vectorizer -pass-remarks-output=%t < %s | FileCheck %s
3 ; RUN: FileCheck --input-file=%t --check-prefix=YAML %s
5 define void @vsub2_test(i32* %pin1, i32* %pin2, i32* %pout) #0 {
6 ; CHECK-LABEL: @vsub2_test(
7 ; CHECK-NEXT: br label [[TMP1:%.*]]
8 ; CHECK: [[IDX_04:%.*]] = phi i32 [ 0, [[TMP0:%.*]] ], [ [[TMP8:%.*]], [[TMP1]] ]
9 ; CHECK-NEXT: [[PO_03:%.*]] = phi i32* [ [[POUT:%.*]], [[TMP0]] ], [ [[TMP7:%.*]], [[TMP1]] ]
10 ; CHECK-NEXT: [[PTMPI2_02:%.*]] = phi i32* [ [[PIN2:%.*]], [[TMP0]] ], [ [[TMP4:%.*]], [[TMP1]] ]
11 ; CHECK-NEXT: [[PTMPI1_01:%.*]] = phi i32* [ [[PIN1:%.*]], [[TMP0]] ], [ [[TMP2:%.*]], [[TMP1]] ]
12 ; CHECK-NEXT: [[TMP2]] = getelementptr inbounds i32, i32* [[PTMPI1_01]], i64 1
13 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[PTMPI1_01]], align 4, !tbaa !1
14 ; CHECK-NEXT: [[TMP4]] = getelementptr inbounds i32, i32* [[PTMPI2_02]], i64 1
15 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[PTMPI2_02]], align 4, !tbaa !1
16 ; CHECK-NEXT: [[TMP6:%.*]] = sub nsw i32 [[TMP3]], [[TMP5]]
17 ; CHECK-NEXT: [[TMP7]] = getelementptr inbounds i32, i32* [[PO_03]], i64 1
18 ; CHECK-NEXT: store i32 [[TMP6]], i32* [[PO_03]], align 4, !tbaa !1
19 ; CHECK-NEXT: [[TMP8]] = add nuw nsw i32 [[IDX_04]], 1
20 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP8]], 64
21 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[TMP9:%.*]], label [[TMP1]], !llvm.loop !5
26 %idx.04 = phi i32 [ 0, %0 ], [ %8, %1 ]
27 %po.03 = phi i32* [ %pout, %0 ], [ %7, %1 ]
28 %ptmpi2.02 = phi i32* [ %pin2, %0 ], [ %4, %1 ]
29 %ptmpi1.01 = phi i32* [ %pin1, %0 ], [ %2, %1 ]
30 %2 = getelementptr inbounds i32, i32* %ptmpi1.01, i64 1
31 %3 = load i32, i32* %ptmpi1.01, align 4, !tbaa !1
32 %4 = getelementptr inbounds i32, i32* %ptmpi2.02, i64 1
33 %5 = load i32, i32* %ptmpi2.02, align 4, !tbaa !1
34 %6 = sub nsw i32 %3, %5
35 %7 = getelementptr inbounds i32, i32* %po.03, i64 1
36 ; YAML: Pass: slp-vectorizer
37 ; YAML-NEXT: Name: NotBeneficial
38 ; YAML-NEXT: Function: vsub2_test
40 ; YAML-NEXT: - String: 'List vectorization was possible but not beneficial with cost '
41 ; YAML-NEXT: - Cost: '0'
42 ; YAML-NEXT: - String: ' >= '
43 ; YAML-NEXT: - Treshold: '0'
44 store i32 %6, i32* %po.03, align 4, !tbaa !1
45 %8 = add nuw nsw i32 %idx.04, 1
46 %exitcond = icmp eq i32 %8, 64
47 br i1 %exitcond, label %9, label %1, !llvm.loop !5
54 !0 = !{!"clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)"}
56 !2 = !{!"int", !3, i64 0}
57 !3 = !{!"omnipotent char", !4, i64 0}
58 !4 = !{!"Simple C/C++ TBAA"}
59 !5 = distinct !{!5, !6, !7}
60 !6 = !{!"llvm.loop.vectorize.width", i32 1}
61 !7 = !{!"llvm.loop.interleave.count", i32 1}