57 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s2 3; CHECK: vecinstrs4define void @vecinstrs() {5 6 ;; Extract element is penalized somewhat with a cost of 2 for index 0.7 extractelement <16 x i8> undef, i32 08 extractelement <16 x i8> undef, i32 19 10 extractelement <8 x i16> undef, i32 011 extractelement <8 x i16> undef, i32 112 13 extractelement <4 x i32> undef, i32 014 extractelement <4 x i32> undef, i32 115 16 extractelement <2 x i64> undef, i32 017 extractelement <2 x i64> undef, i32 118 19 extractelement <2 x double> undef, i32 020 extractelement <2 x double> undef, i32 121 22 ; Extraction of i1 means extract + test under mask before branch.23 extractelement <2 x i1> undef, i32 024 extractelement <4 x i1> undef, i32 125 extractelement <8 x i1> undef, i32 226 27 ;; Insert element28 insertelement <16 x i8> undef, i8 undef, i32 029 insertelement <8 x i16> undef, i16 undef, i32 030 insertelement <4 x i32> undef, i32 undef, i32 031 32 ; vlvgp will do two grs into a vector register: only add cost half of the time.33 insertelement <2 x i64> undef, i64 undef, i32 034 insertelement <2 x i64> undef, i64 undef, i32 135 36 ret void37 38; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %1 = extractelement <16 x i8> undef, i32 039; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %2 = extractelement <16 x i8> undef, i32 140; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %3 = extractelement <8 x i16> undef, i32 041; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %4 = extractelement <8 x i16> undef, i32 142; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %5 = extractelement <4 x i32> undef, i32 043; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %6 = extractelement <4 x i32> undef, i32 144; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %7 = extractelement <2 x i64> undef, i32 045; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %8 = extractelement <2 x i64> undef, i32 146; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %9 = extractelement <2 x double> undef, i32 047; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %10 = extractelement <2 x double> undef, i32 148; CHECK: Cost Model: Found an estimated cost of 3 for instruction: %11 = extractelement <2 x i1> undef, i32 049; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %12 = extractelement <4 x i1> undef, i32 150; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %13 = extractelement <8 x i1> undef, i32 251; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %14 = insertelement <16 x i8> undef, i8 undef, i32 052; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %15 = insertelement <8 x i16> undef, i16 undef, i32 053; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %16 = insertelement <4 x i32> undef, i32 undef, i32 054; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %17 = insertelement <2 x i64> undef, i64 undef, i32 055; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %18 = insertelement <2 x i64> undef, i64 undef, i32 156}57