brintos

brintos / llvm-project-archived public Read only

0
0
Text · 16.0 KiB · db7d4dd Raw
185 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s3; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s4; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE5; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE6 7define i32 @reduce_i1(i32 %arg) {8; CHECK-LABEL: 'reduce_i1'9; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)10; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)11; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)12; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)13; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)14; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)15; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)16; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)17; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)18; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)19; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)20; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef21;22; SIZE-LABEL: 'reduce_i1'23; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)24; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)25; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)26; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)27; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)28; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)29; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)30; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)31; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)32; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)33; SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)34; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef35;36  %V1   = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)37  %V2   = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)38  %V4   = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)39  %V8   = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)40  %V16  = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)41  %V32  = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)42  %V64  = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)43  %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)44  %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)45  %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)46  %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)47  ret i32 undef48}49 50define i32 @reduce_i8(i32 %arg) {51; CHECK-LABEL: 'reduce_i8'52; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)53; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)54; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)55; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)56; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)57; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)58; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)59; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)60; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef61;62; SIZE-LABEL: 'reduce_i8'63; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)64; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)65; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)66; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)67; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)68; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)69; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)70; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)71; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef72;73  %V1   = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)74  %V2   = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)75  %V4   = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)76  %V8   = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)77  %V16  = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)78  %V32  = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)79  %V64  = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)80  %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)81  ret i32 undef82}83 84define i32 @reduce_i16(i32 %arg) {85; CHECK-LABEL: 'reduce_i16'86; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)87; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)88; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)89; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)90; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)91; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)92; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)93; CHECK-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)94; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef95;96; SIZE-LABEL: 'reduce_i16'97; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)98; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)99; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)100; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)101; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)102; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)103; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)104; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)105; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef106;107  %V1   = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)108  %V2   = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)109  %V4   = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)110  %V8   = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)111  %V16  = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)112  %V32  = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)113  %V64  = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)114  %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)115  ret i32 undef116}117 118define i32 @reduce_i32(i32 %arg) {119; CHECK-LABEL: 'reduce_i32'120; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)121; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)122; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)123; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)124; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)125; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)126; CHECK-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V64 = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)127; CHECK-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)128; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef129;130; SIZE-LABEL: 'reduce_i32'131; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)132; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)133; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)134; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)135; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)136; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)137; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V64 = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)138; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)139; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef140;141  %V1   = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)142  %V2   = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)143  %V4   = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)144  %V8   = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)145  %V16  = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)146  %V32  = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)147  %V64  = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)148  %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)149  ret i32 undef150}151 152define i32 @reduce_i64(i32 %arg) {153; CHECK-LABEL: 'reduce_i64'154; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)155; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)156; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)157; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)158; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)159; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V32 = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)160; CHECK-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V64 = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)161; CHECK-NEXT:  Cost Model: Found an estimated cost of 61 for instruction: %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)162; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef163;164; SIZE-LABEL: 'reduce_i64'165; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)166; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)167; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)168; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)169; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)170; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32 = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)171; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64 = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)172; SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)173; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef174;175  %V1   = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)176  %V2   = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)177  %V4   = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)178  %V8   = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)179  %V16  = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)180  %V32  = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)181  %V64  = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)182  %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)183  ret i32 undef184}185