1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py 2; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s 3; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s 4; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE 5; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE 6 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.and.v1i1(<1 x i1> undef) 10; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef) 11; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef) 12; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef) 13; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef) 14; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef) 15; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef) 16; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef) 17; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.and.v256i1(<256 x i1> undef) 18; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.and.v512i1(<512 x i1> undef) 19; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1> undef) 20; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV1 = call i1 @llvm.vector.reduce.and.nxv1i1(<vscale x 1 x i1> undef) 21; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV2 = call i1 @llvm.vector.reduce.and.nxv2i1(<vscale x 2 x i1> undef) 22; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV4 = call i1 @llvm.vector.reduce.and.nxv4i1(<vscale x 4 x i1> undef) 23; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV8 = call i1 @llvm.vector.reduce.and.nxv8i1(<vscale x 8 x i1> undef) 24; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV16 = call i1 @llvm.vector.reduce.and.nxv16i1(<vscale x 16 x i1> undef) 25; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV32 = call i1 @llvm.vector.reduce.and.nxv32i1(<vscale x 32 x i1> undef) 26; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV64 = call i1 @llvm.vector.reduce.and.nxv64i1(<vscale x 64 x i1> undef) 27; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV128 = call i1 @llvm.vector.reduce.and.nxv128i1(<vscale x 128 x i1> undef) 28; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %NXV256 = call i1 @llvm.vector.reduce.and.nxv256i1(<vscale x 256 x i1> undef) 29; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %NXV512 = call i1 @llvm.vector.reduce.and.nxv512i1(<vscale x 512 x i1> undef) 30; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %NXV1024 = call i1 @llvm.vector.reduce.and.nxv1024i1(<vscale x 1024 x i1> undef) 31; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 32; 33; SIZE-LABEL: 'reduce_i1' 34; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef) 35; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef) 36; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef) 37; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef) 38; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef) 39; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef) 40; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef) 41; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef) 42; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.and.v256i1(<256 x i1> undef) 43; SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.and.v512i1(<512 x i1> undef) 44; SIZE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1> undef) 45; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV1 = call i1 @llvm.vector.reduce.and.nxv1i1(<vscale x 1 x i1> undef) 46; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV2 = call i1 @llvm.vector.reduce.and.nxv2i1(<vscale x 2 x i1> undef) 47; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV4 = call i1 @llvm.vector.reduce.and.nxv4i1(<vscale x 4 x i1> undef) 48; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV8 = call i1 @llvm.vector.reduce.and.nxv8i1(<vscale x 8 x i1> undef) 49; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV16 = call i1 @llvm.vector.reduce.and.nxv16i1(<vscale x 16 x i1> undef) 50; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV32 = call i1 @llvm.vector.reduce.and.nxv32i1(<vscale x 32 x i1> undef) 51; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV64 = call i1 @llvm.vector.reduce.and.nxv64i1(<vscale x 64 x i1> undef) 52; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV128 = call i1 @llvm.vector.reduce.and.nxv128i1(<vscale x 128 x i1> undef) 53; SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %NXV256 = call i1 @llvm.vector.reduce.and.nxv256i1(<vscale x 256 x i1> undef) 54; SIZE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %NXV512 = call i1 @llvm.vector.reduce.and.nxv512i1(<vscale x 512 x i1> undef) 55; SIZE-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %NXV1024 = call i1 @llvm.vector.reduce.and.nxv1024i1(<vscale x 1024 x i1> undef) 56; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 57; 58 %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef) 59 %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef) 60 %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef) 61 %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef) 62 %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef) 63 %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef) 64 %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef) 65 %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef) 66 %V256 = call i1 @llvm.vector.reduce.and.v256i1(<256 x i1> undef) 67 %V512 = call i1 @llvm.vector.reduce.and.v512i1(<512 x i1> undef) 68 %V1024 = call i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1> undef) 69 70 %NXV1 = call i1 @llvm.vector.reduce.and.nxv1i1(<vscale x 1 x i1> undef) 71 %NXV2 = call i1 @llvm.vector.reduce.and.nxv2i1(<vscale x 2 x i1> undef) 72 %NXV4 = call i1 @llvm.vector.reduce.and.nxv4i1(<vscale x 4 x i1> undef) 73 %NXV8 = call i1 @llvm.vector.reduce.and.nxv8i1(<vscale x 8 x i1> undef) 74 %NXV16 = call i1 @llvm.vector.reduce.and.nxv16i1(<vscale x 16 x i1> undef) 75 %NXV32 = call i1 @llvm.vector.reduce.and.nxv32i1(<vscale x 32 x i1> undef) 76 %NXV64 = call i1 @llvm.vector.reduce.and.nxv64i1(<vscale x 64 x i1> undef) 77 %NXV128 = call i1 @llvm.vector.reduce.and.nxv128i1(<vscale x 128 x i1> undef) 78 %NXV256 = call i1 @llvm.vector.reduce.and.nxv256i1(<vscale x 256 x i1> undef) 79 %NXV512 = call i1 @llvm.vector.reduce.and.nxv512i1(<vscale x 512 x i1> undef) 80 %NXV1024 = call i1 @llvm.vector.reduce.and.nxv1024i1(<vscale x 1024 x i1> undef) 81 ret i32 undef 82} 83 84define i32 @reduce_i8(i32 %arg) { 85; CHECK-LABEL: 'reduce_i8' 86; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i8 @llvm.vector.reduce.and.v1i8(<1 x i8> undef) 87; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.and.v2i8(<2 x i8> undef) 88; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i8 @llvm.vector.reduce.and.v4i8(<4 x i8> undef) 89; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i8 @llvm.vector.reduce.and.v8i8(<8 x i8> undef) 90; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i8 @llvm.vector.reduce.and.v16i8(<16 x i8> undef) 91; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i8 @llvm.vector.reduce.and.v32i8(<32 x i8> undef) 92; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i8 @llvm.vector.reduce.and.v64i8(<64 x i8> undef) 93; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V128 = call i8 @llvm.vector.reduce.and.v128i8(<128 x i8> undef) 94; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 95; 96; SIZE-LABEL: 'reduce_i8' 97; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i8 @llvm.vector.reduce.and.v1i8(<1 x i8> undef) 98; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.and.v2i8(<2 x i8> undef) 99; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.vector.reduce.and.v4i8(<4 x i8> undef) 100; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.vector.reduce.and.v8i8(<8 x i8> undef) 101; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i8 @llvm.vector.reduce.and.v16i8(<16 x i8> undef) 102; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i8 @llvm.vector.reduce.and.v32i8(<32 x i8> undef) 103; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i8 @llvm.vector.reduce.and.v64i8(<64 x i8> undef) 104; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i8 @llvm.vector.reduce.and.v128i8(<128 x i8> undef) 105; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 106; 107 %V1 = call i8 @llvm.vector.reduce.and.v1i8(<1 x i8> undef) 108 %V2 = call i8 @llvm.vector.reduce.and.v2i8(<2 x i8> undef) 109 %V4 = call i8 @llvm.vector.reduce.and.v4i8(<4 x i8> undef) 110 %V8 = call i8 @llvm.vector.reduce.and.v8i8(<8 x i8> undef) 111 %V16 = call i8 @llvm.vector.reduce.and.v16i8(<16 x i8> undef) 112 %V32 = call i8 @llvm.vector.reduce.and.v32i8(<32 x i8> undef) 113 %V64 = call i8 @llvm.vector.reduce.and.v64i8(<64 x i8> undef) 114 %V128 = call i8 @llvm.vector.reduce.and.v128i8(<128 x i8> undef) 115 ret i32 undef 116} 117 118define i32 @reduce_i16(i32 %arg) { 119; CHECK-LABEL: 'reduce_i16' 120; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i16 @llvm.vector.reduce.and.v1i16(<1 x i16> undef) 121; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.and.v2i16(<2 x i16> undef) 122; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.vector.reduce.and.v4i16(<4 x i16> undef) 123; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.vector.reduce.and.v8i16(<8 x i16> undef) 124; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.vector.reduce.and.v16i16(<16 x i16> undef) 125; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i16 @llvm.vector.reduce.and.v32i16(<32 x i16> undef) 126; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i16 @llvm.vector.reduce.and.v64i16(<64 x i16> undef) 127; CHECK-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %V128 = call i16 @llvm.vector.reduce.and.v128i16(<128 x i16> undef) 128; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 129; 130; SIZE-LABEL: 'reduce_i16' 131; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i16 @llvm.vector.reduce.and.v1i16(<1 x i16> undef) 132; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.and.v2i16(<2 x i16> undef) 133; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i16 @llvm.vector.reduce.and.v4i16(<4 x i16> undef) 134; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i16 @llvm.vector.reduce.and.v8i16(<8 x i16> undef) 135; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i16 @llvm.vector.reduce.and.v16i16(<16 x i16> undef) 136; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i16 @llvm.vector.reduce.and.v32i16(<32 x i16> undef) 137; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i16 @llvm.vector.reduce.and.v64i16(<64 x i16> undef) 138; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V128 = call i16 @llvm.vector.reduce.and.v128i16(<128 x i16> undef) 139; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 140; 141 %V1 = call i16 @llvm.vector.reduce.and.v1i16(<1 x i16> undef) 142 %V2 = call i16 @llvm.vector.reduce.and.v2i16(<2 x i16> undef) 143 %V4 = call i16 @llvm.vector.reduce.and.v4i16(<4 x i16> undef) 144 %V8 = call i16 @llvm.vector.reduce.and.v8i16(<8 x i16> undef) 145 %V16 = call i16 @llvm.vector.reduce.and.v16i16(<16 x i16> undef) 146 %V32 = call i16 @llvm.vector.reduce.and.v32i16(<32 x i16> undef) 147 %V64 = call i16 @llvm.vector.reduce.and.v64i16(<64 x i16> undef) 148 %V128 = call i16 @llvm.vector.reduce.and.v128i16(<128 x i16> undef) 149 ret i32 undef 150} 151 152define i32 @reduce_i32(i32 %arg) { 153; CHECK-LABEL: 'reduce_i32' 154; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i32 @llvm.vector.reduce.and.v1i32(<1 x i32> undef) 155; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.and.v2i32(<2 x i32> undef) 156; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> undef) 157; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i32 @llvm.vector.reduce.and.v8i32(<8 x i32> undef) 158; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> undef) 159; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i32 @llvm.vector.reduce.and.v32i32(<32 x i32> undef) 160; CHECK-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %V64 = call i32 @llvm.vector.reduce.and.v64i32(<64 x i32> undef) 161; CHECK-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %V128 = call i32 @llvm.vector.reduce.and.v128i32(<128 x i32> undef) 162; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 163; 164; SIZE-LABEL: 'reduce_i32' 165; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i32 @llvm.vector.reduce.and.v1i32(<1 x i32> undef) 166; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.and.v2i32(<2 x i32> undef) 167; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> undef) 168; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i32 @llvm.vector.reduce.and.v8i32(<8 x i32> undef) 169; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> undef) 170; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i32 @llvm.vector.reduce.and.v32i32(<32 x i32> undef) 171; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V64 = call i32 @llvm.vector.reduce.and.v64i32(<64 x i32> undef) 172; SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V128 = call i32 @llvm.vector.reduce.and.v128i32(<128 x i32> undef) 173; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 174; 175 %V1 = call i32 @llvm.vector.reduce.and.v1i32(<1 x i32> undef) 176 %V2 = call i32 @llvm.vector.reduce.and.v2i32(<2 x i32> undef) 177 %V4 = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> undef) 178 %V8 = call i32 @llvm.vector.reduce.and.v8i32(<8 x i32> undef) 179 %V16 = call i32 @llvm.vector.reduce.and.v16i32(<16 x i32> undef) 180 %V32 = call i32 @llvm.vector.reduce.and.v32i32(<32 x i32> undef) 181 %V64 = call i32 @llvm.vector.reduce.and.v64i32(<64 x i32> undef) 182 %V128 = call i32 @llvm.vector.reduce.and.v128i32(<128 x i32> undef) 183 ret i32 undef 184} 185 186define i32 @reduce_i64(i32 %arg) { 187; CHECK-LABEL: 'reduce_i64' 188; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i64 @llvm.vector.reduce.and.v1i64(<1 x i64> undef) 189; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.and.v2i64(<2 x i64> undef) 190; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i64 @llvm.vector.reduce.and.v4i64(<4 x i64> undef) 191; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> undef) 192; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i64 @llvm.vector.reduce.and.v16i64(<16 x i64> undef) 193; CHECK-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %V32 = call i64 @llvm.vector.reduce.and.v32i64(<32 x i64> undef) 194; CHECK-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %V64 = call i64 @llvm.vector.reduce.and.v64i64(<64 x i64> undef) 195; CHECK-NEXT: Cost Model: Found an estimated cost of 61 for instruction: %V128 = call i64 @llvm.vector.reduce.and.v128i64(<128 x i64> undef) 196; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 197; 198; SIZE-LABEL: 'reduce_i64' 199; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i64 @llvm.vector.reduce.and.v1i64(<1 x i64> undef) 200; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.and.v2i64(<2 x i64> undef) 201; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i64 @llvm.vector.reduce.and.v4i64(<4 x i64> undef) 202; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> undef) 203; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i64 @llvm.vector.reduce.and.v16i64(<16 x i64> undef) 204; SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V32 = call i64 @llvm.vector.reduce.and.v32i64(<32 x i64> undef) 205; SIZE-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V64 = call i64 @llvm.vector.reduce.and.v64i64(<64 x i64> undef) 206; SIZE-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V128 = call i64 @llvm.vector.reduce.and.v128i64(<128 x i64> undef) 207; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 208; 209 %V1 = call i64 @llvm.vector.reduce.and.v1i64(<1 x i64> undef) 210 %V2 = call i64 @llvm.vector.reduce.and.v2i64(<2 x i64> undef) 211 %V4 = call i64 @llvm.vector.reduce.and.v4i64(<4 x i64> undef) 212 %V8 = call i64 @llvm.vector.reduce.and.v8i64(<8 x i64> undef) 213 %V16 = call i64 @llvm.vector.reduce.and.v16i64(<16 x i64> undef) 214 %V32 = call i64 @llvm.vector.reduce.and.v32i64(<32 x i64> undef) 215 %V64 = call i64 @llvm.vector.reduce.and.v64i64(<64 x i64> undef) 216 %V128 = call i64 @llvm.vector.reduce.and.v128i64(<128 x i64> undef) 217 ret i32 undef 218} 219 220declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>) 221declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>) 222declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>) 223declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>) 224declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>) 225declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>) 226declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>) 227declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>) 228declare i1 @llvm.vector.reduce.and.v256i1(<256 x i1>) 229declare i1 @llvm.vector.reduce.and.v512i1(<512 x i1>) 230declare i1 @llvm.vector.reduce.and.v1024i1(<1024 x i1>) 231declare i8 @llvm.vector.reduce.and.v1i8(<1 x i8>) 232declare i8 @llvm.vector.reduce.and.v2i8(<2 x i8>) 233declare i8 @llvm.vector.reduce.and.v4i8(<4 x i8>) 234declare i8 @llvm.vector.reduce.and.v8i8(<8 x i8>) 235declare i8 @llvm.vector.reduce.and.v16i8(<16 x i8>) 236declare i8 @llvm.vector.reduce.and.v32i8(<32 x i8>) 237declare i8 @llvm.vector.reduce.and.v64i8(<64 x i8>) 238declare i8 @llvm.vector.reduce.and.v128i8(<128 x i8>) 239declare i16 @llvm.vector.reduce.and.v1i16(<1 x i16>) 240declare i16 @llvm.vector.reduce.and.v2i16(<2 x i16>) 241declare i16 @llvm.vector.reduce.and.v4i16(<4 x i16>) 242declare i16 @llvm.vector.reduce.and.v8i16(<8 x i16>) 243declare i16 @llvm.vector.reduce.and.v16i16(<16 x i16>) 244declare i16 @llvm.vector.reduce.and.v32i16(<32 x i16>) 245declare i16 @llvm.vector.reduce.and.v64i16(<64 x i16>) 246declare i16 @llvm.vector.reduce.and.v128i16(<128 x i16>) 247declare i32 @llvm.vector.reduce.and.v1i32(<1 x i32>) 248declare i32 @llvm.vector.reduce.and.v2i32(<2 x i32>) 249declare i32 @llvm.vector.reduce.and.v4i32(<4 x i32>) 250declare i32 @llvm.vector.reduce.and.v8i32(<8 x i32>) 251declare i32 @llvm.vector.reduce.and.v16i32(<16 x i32>) 252declare i32 @llvm.vector.reduce.and.v32i32(<32 x i32>) 253declare i32 @llvm.vector.reduce.and.v64i32(<64 x i32>) 254declare i32 @llvm.vector.reduce.and.v128i32(<128 x i32>) 255declare i64 @llvm.vector.reduce.and.v1i64(<1 x i64>) 256declare i64 @llvm.vector.reduce.and.v2i64(<2 x i64>) 257declare i64 @llvm.vector.reduce.and.v4i64(<4 x i64>) 258declare i64 @llvm.vector.reduce.and.v8i64(<8 x i64>) 259declare i64 @llvm.vector.reduce.and.v16i64(<16 x i64>) 260declare i64 @llvm.vector.reduce.and.v32i64(<32 x i64>) 261declare i64 @llvm.vector.reduce.and.v64i64(<64 x i64>) 262declare i64 @llvm.vector.reduce.and.v128i64(<128 x i64>) 263