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