61 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu -slp-revec -pass-remarks-output=%t < %s | FileCheck %s3; RUN: FileCheck --input-file=%t --check-prefix=YAML %s4 5; See https://reviews.llvm.org/D70068 and https://reviews.llvm.org/D70587 for context6 7; YAML: --- !Passed8; YAML: Pass: slp-vectorizer9; YAML: Name: VectorizedList10; YAML: Function: StructOfVectors11; YAML: Args:12; YAML: - String: 'SLP vectorized with cost '13; YAML: - Cost: '-10'14; YAML: - String: ' and with tree size '15; YAML: - TreeSize: '3'16 17; YAML: --- !Missed18; YAML: Pass: slp-vectorizer19; YAML: Name: NotBeneficial20; YAML: Function: StructOfVectors21; YAML: Args:22; YAML: - String: 'List vectorization was possible but not beneficial with cost '23; YAML: - Cost: '0'24; YAML: - String: ' >= '25; YAML: - Treshold: '0'26 27; Checks that vector insertvalues into the struct become SLP seeds.28define { <2 x float>, <2 x float> } @StructOfVectors(ptr %Ptr) {29; CHECK-LABEL: @StructOfVectors(30; CHECK-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr [[PTR:%.*]], align 431; CHECK-NEXT: [[TMP2:%.*]] = fadd fast <4 x float> [[TMP1]], <float 1.100000e+01, float 1.200000e+01, float 1.300000e+01, float 1.400000e+01>32; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> poison, <2 x i32> <i32 0, i32 1>33; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> poison, <2 x i32> <i32 2, i32 3>34; CHECK-NEXT: [[RET0:%.*]] = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> [[TMP6]], 035; CHECK-NEXT: [[RET1:%.*]] = insertvalue { <2 x float>, <2 x float> } [[RET0]], <2 x float> [[TMP7]], 136; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[RET1]]37;38 %L0 = load float, ptr %Ptr39 %GEP1 = getelementptr inbounds float, ptr %Ptr, i64 140 %L1 = load float, ptr %GEP141 %GEP2 = getelementptr inbounds float, ptr %Ptr, i64 242 %L2 = load float, ptr %GEP243 %GEP3 = getelementptr inbounds float, ptr %Ptr, i64 344 %L3 = load float, ptr %GEP345 46 %Fadd0 = fadd fast float %L0, 1.1e+0147 %Fadd1 = fadd fast float %L1, 1.2e+0148 %Fadd2 = fadd fast float %L2, 1.3e+0149 %Fadd3 = fadd fast float %L3, 1.4e+0150 51 %VecIn0 = insertelement <2 x float> poison, float %Fadd0, i64 052 %VecIn1 = insertelement <2 x float> %VecIn0, float %Fadd1, i64 153 54 %VecIn2 = insertelement <2 x float> poison, float %Fadd2, i64 055 %VecIn3 = insertelement <2 x float> %VecIn2, float %Fadd3, i64 156 57 %Ret0 = insertvalue {<2 x float>, <2 x float>} poison, <2 x float> %VecIn1, 058 %Ret1 = insertvalue {<2 x float>, <2 x float>} %Ret0, <2 x float> %VecIn3, 159 ret {<2 x float>, <2 x float>} %Ret160}61