1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py 2; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=-lzcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,NOLZCNT 3; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,LZCNT,SSE2 4; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+sse4.2 | FileCheck %s -check-prefixes=CHECK,LZCNT,SSE42 5; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+avx | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX,AVX1 6; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+avx2 | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX,AVX2 7; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+avx512f | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX512,AVX512F 8; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX512,AVX512BW 9; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+lzcnt,+avx512vl,+avx512bw,+avx512dq,+avx512cd | FileCheck %s -check-prefixes=CHECK,LZCNT,AVX512CD 10 11; Verify the cost of scalar leading zero count instructions. 12 13declare i64 @llvm.ctlz.i64(i64, i1) 14declare i32 @llvm.ctlz.i32(i32, i1) 15declare i16 @llvm.ctlz.i16(i16, i1) 16declare i8 @llvm.ctlz.i8(i8, i1) 17 18define i64 @var_ctlz_i64(i64 %a) { 19; NOLZCNT-LABEL: 'var_ctlz_i64' 20; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 false) 21; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %ctlz 22; 23; LZCNT-LABEL: 'var_ctlz_i64' 24; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 false) 25; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %ctlz 26; 27 %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 0) 28 ret i64 %ctlz 29} 30 31define i64 @var_ctlz_i64u(i64 %a) { 32; NOLZCNT-LABEL: 'var_ctlz_i64u' 33; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 true) 34; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %ctlz 35; 36; LZCNT-LABEL: 'var_ctlz_i64u' 37; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 true) 38; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %ctlz 39; 40 %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 1) 41 ret i64 %ctlz 42} 43 44define i32 @var_ctlz_i32(i32 %a) { 45; NOLZCNT-LABEL: 'var_ctlz_i32' 46; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 false) 47; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %ctlz 48; 49; LZCNT-LABEL: 'var_ctlz_i32' 50; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 false) 51; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %ctlz 52; 53 %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 0) 54 ret i32 %ctlz 55} 56 57define i32 @var_ctlz_i32u(i32 %a) { 58; NOLZCNT-LABEL: 'var_ctlz_i32u' 59; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 true) 60; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %ctlz 61; 62; LZCNT-LABEL: 'var_ctlz_i32u' 63; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 true) 64; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %ctlz 65; 66 %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 1) 67 ret i32 %ctlz 68} 69 70define i16 @var_ctlz_i16(i16 %a) { 71; NOLZCNT-LABEL: 'var_ctlz_i16' 72; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 false) 73; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %ctlz 74; 75; LZCNT-LABEL: 'var_ctlz_i16' 76; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 false) 77; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %ctlz 78; 79 %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 0) 80 ret i16 %ctlz 81} 82 83define i16 @var_ctlz_i16u(i16 %a) { 84; NOLZCNT-LABEL: 'var_ctlz_i16u' 85; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 true) 86; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %ctlz 87; 88; LZCNT-LABEL: 'var_ctlz_i16u' 89; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 true) 90; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i16 %ctlz 91; 92 %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 1) 93 ret i16 %ctlz 94} 95 96define i8 @var_ctlz_i8(i8 %a) { 97; NOLZCNT-LABEL: 'var_ctlz_i8' 98; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 false) 99; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctlz 100; 101; LZCNT-LABEL: 'var_ctlz_i8' 102; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 false) 103; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctlz 104; 105 %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 0) 106 ret i8 %ctlz 107} 108 109define i8 @var_ctlz_i8u(i8 %a) { 110; NOLZCNT-LABEL: 'var_ctlz_i8u' 111; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 true) 112; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctlz 113; 114; LZCNT-LABEL: 'var_ctlz_i8u' 115; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 true) 116; LZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctlz 117; 118 %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 1) 119 ret i8 %ctlz 120} 121 122; Verify the cost of vector leading zero count instructions. 123 124declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1) 125declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1) 126declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1) 127declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1) 128 129declare <4 x i64> @llvm.ctlz.v4i64(<4 x i64>, i1) 130declare <8 x i32> @llvm.ctlz.v8i32(<8 x i32>, i1) 131declare <16 x i16> @llvm.ctlz.v16i16(<16 x i16>, i1) 132declare <32 x i8> @llvm.ctlz.v32i8(<32 x i8>, i1) 133 134declare <8 x i64> @llvm.ctlz.v8i64(<8 x i64>, i1) 135declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1) 136declare <32 x i16> @llvm.ctlz.v32i16(<32 x i16>, i1) 137declare <64 x i8> @llvm.ctlz.v64i8(<64 x i8>, i1) 138 139define <2 x i64> @var_ctlz_v2i64(<2 x i64> %a) { 140; NOLZCNT-LABEL: 'var_ctlz_v2i64' 141; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 142; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 143; 144; SSE2-LABEL: 'var_ctlz_v2i64' 145; SSE2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 146; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 147; 148; SSE42-LABEL: 'var_ctlz_v2i64' 149; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 150; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 151; 152; AVX-LABEL: 'var_ctlz_v2i64' 153; AVX-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 154; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 155; 156; AVX512-LABEL: 'var_ctlz_v2i64' 157; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 158; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 159; 160; AVX512CD-LABEL: 'var_ctlz_v2i64' 161; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) 162; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 163; 164 %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 0) 165 ret <2 x i64> %ctlz 166} 167 168define <2 x i64> @var_ctlz_v2i64u(<2 x i64> %a) { 169; NOLZCNT-LABEL: 'var_ctlz_v2i64u' 170; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 171; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 172; 173; SSE2-LABEL: 'var_ctlz_v2i64u' 174; SSE2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 175; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 176; 177; SSE42-LABEL: 'var_ctlz_v2i64u' 178; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 179; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 180; 181; AVX-LABEL: 'var_ctlz_v2i64u' 182; AVX-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 183; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 184; 185; AVX512-LABEL: 'var_ctlz_v2i64u' 186; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 187; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 188; 189; AVX512CD-LABEL: 'var_ctlz_v2i64u' 190; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) 191; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %ctlz 192; 193 %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 1) 194 ret <2 x i64> %ctlz 195} 196 197define <4 x i64> @var_ctlz_v4i64(<4 x i64> %a) { 198; NOLZCNT-LABEL: 'var_ctlz_v4i64' 199; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 200; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 201; 202; SSE2-LABEL: 'var_ctlz_v4i64' 203; SSE2-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 204; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 205; 206; SSE42-LABEL: 'var_ctlz_v4i64' 207; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 208; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 209; 210; AVX1-LABEL: 'var_ctlz_v4i64' 211; AVX1-NEXT: Cost Model: Found an estimated cost of 49 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 212; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 213; 214; AVX2-LABEL: 'var_ctlz_v4i64' 215; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 216; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 217; 218; AVX512-LABEL: 'var_ctlz_v4i64' 219; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 220; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 221; 222; AVX512CD-LABEL: 'var_ctlz_v4i64' 223; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) 224; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 225; 226 %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 0) 227 ret <4 x i64> %ctlz 228} 229 230define <4 x i64> @var_ctlz_v4i64u(<4 x i64> %a) { 231; NOLZCNT-LABEL: 'var_ctlz_v4i64u' 232; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 233; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 234; 235; SSE2-LABEL: 'var_ctlz_v4i64u' 236; SSE2-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 237; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 238; 239; SSE42-LABEL: 'var_ctlz_v4i64u' 240; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 241; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 242; 243; AVX1-LABEL: 'var_ctlz_v4i64u' 244; AVX1-NEXT: Cost Model: Found an estimated cost of 49 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 245; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 246; 247; AVX2-LABEL: 'var_ctlz_v4i64u' 248; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 249; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 250; 251; AVX512-LABEL: 'var_ctlz_v4i64u' 252; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 253; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 254; 255; AVX512CD-LABEL: 'var_ctlz_v4i64u' 256; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) 257; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %ctlz 258; 259 %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 1) 260 ret <4 x i64> %ctlz 261} 262 263define <8 x i64> @var_ctlz_v8i64(<8 x i64> %a) { 264; NOLZCNT-LABEL: 'var_ctlz_v8i64' 265; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 266; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 267; 268; SSE2-LABEL: 'var_ctlz_v8i64' 269; SSE2-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 270; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 271; 272; SSE42-LABEL: 'var_ctlz_v8i64' 273; SSE42-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 274; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 275; 276; AVX1-LABEL: 'var_ctlz_v8i64' 277; AVX1-NEXT: Cost Model: Found an estimated cost of 98 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 278; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 279; 280; AVX2-LABEL: 'var_ctlz_v8i64' 281; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 282; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 283; 284; AVX512F-LABEL: 'var_ctlz_v8i64' 285; AVX512F-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 286; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 287; 288; AVX512BW-LABEL: 'var_ctlz_v8i64' 289; AVX512BW-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 290; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 291; 292; AVX512CD-LABEL: 'var_ctlz_v8i64' 293; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) 294; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 295; 296 %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 0) 297 ret <8 x i64> %ctlz 298} 299 300define <8 x i64> @var_ctlz_v8i64u(<8 x i64> %a) { 301; NOLZCNT-LABEL: 'var_ctlz_v8i64u' 302; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 303; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 304; 305; SSE2-LABEL: 'var_ctlz_v8i64u' 306; SSE2-NEXT: Cost Model: Found an estimated cost of 144 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 307; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 308; 309; SSE42-LABEL: 'var_ctlz_v8i64u' 310; SSE42-NEXT: Cost Model: Found an estimated cost of 112 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 311; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 312; 313; AVX1-LABEL: 'var_ctlz_v8i64u' 314; AVX1-NEXT: Cost Model: Found an estimated cost of 98 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 315; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 316; 317; AVX2-LABEL: 'var_ctlz_v8i64u' 318; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 319; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 320; 321; AVX512F-LABEL: 'var_ctlz_v8i64u' 322; AVX512F-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 323; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 324; 325; AVX512BW-LABEL: 'var_ctlz_v8i64u' 326; AVX512BW-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 327; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 328; 329; AVX512CD-LABEL: 'var_ctlz_v8i64u' 330; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) 331; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i64> %ctlz 332; 333 %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 1) 334 ret <8 x i64> %ctlz 335} 336 337define <4 x i32> @var_ctlz_v4i32(<4 x i32> %a) { 338; NOLZCNT-LABEL: 'var_ctlz_v4i32' 339; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 340; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 341; 342; SSE2-LABEL: 'var_ctlz_v4i32' 343; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 344; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 345; 346; SSE42-LABEL: 'var_ctlz_v4i32' 347; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 348; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 349; 350; AVX-LABEL: 'var_ctlz_v4i32' 351; AVX-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 352; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 353; 354; AVX512-LABEL: 'var_ctlz_v4i32' 355; AVX512-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 356; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 357; 358; AVX512CD-LABEL: 'var_ctlz_v4i32' 359; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) 360; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 361; 362 %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 0) 363 ret <4 x i32> %ctlz 364} 365 366define <4 x i32> @var_ctlz_v4i32u(<4 x i32> %a) { 367; NOLZCNT-LABEL: 'var_ctlz_v4i32u' 368; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 369; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 370; 371; SSE2-LABEL: 'var_ctlz_v4i32u' 372; SSE2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 373; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 374; 375; SSE42-LABEL: 'var_ctlz_v4i32u' 376; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 377; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 378; 379; AVX-LABEL: 'var_ctlz_v4i32u' 380; AVX-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 381; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 382; 383; AVX512-LABEL: 'var_ctlz_v4i32u' 384; AVX512-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 385; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 386; 387; AVX512CD-LABEL: 'var_ctlz_v4i32u' 388; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) 389; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %ctlz 390; 391 %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 1) 392 ret <4 x i32> %ctlz 393} 394 395define <8 x i32> @var_ctlz_v8i32(<8 x i32> %a) { 396; NOLZCNT-LABEL: 'var_ctlz_v8i32' 397; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 398; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 399; 400; SSE2-LABEL: 'var_ctlz_v8i32' 401; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 402; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 403; 404; SSE42-LABEL: 'var_ctlz_v8i32' 405; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 406; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 407; 408; AVX1-LABEL: 'var_ctlz_v8i32' 409; AVX1-NEXT: Cost Model: Found an estimated cost of 39 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 410; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 411; 412; AVX2-LABEL: 'var_ctlz_v8i32' 413; AVX2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 414; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 415; 416; AVX512-LABEL: 'var_ctlz_v8i32' 417; AVX512-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 418; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 419; 420; AVX512CD-LABEL: 'var_ctlz_v8i32' 421; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) 422; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 423; 424 %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 0) 425 ret <8 x i32> %ctlz 426} 427 428define <8 x i32> @var_ctlz_v8i32u(<8 x i32> %a) { 429; NOLZCNT-LABEL: 'var_ctlz_v8i32u' 430; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 431; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 432; 433; SSE2-LABEL: 'var_ctlz_v8i32u' 434; SSE2-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 435; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 436; 437; SSE42-LABEL: 'var_ctlz_v8i32u' 438; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 439; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 440; 441; AVX1-LABEL: 'var_ctlz_v8i32u' 442; AVX1-NEXT: Cost Model: Found an estimated cost of 39 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 443; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 444; 445; AVX2-LABEL: 'var_ctlz_v8i32u' 446; AVX2-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 447; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 448; 449; AVX512-LABEL: 'var_ctlz_v8i32u' 450; AVX512-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 451; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 452; 453; AVX512CD-LABEL: 'var_ctlz_v8i32u' 454; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) 455; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %ctlz 456; 457 %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 1) 458 ret <8 x i32> %ctlz 459} 460 461define <16 x i32> @var_ctlz_v16i32(<16 x i32> %a) { 462; NOLZCNT-LABEL: 'var_ctlz_v16i32' 463; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 152 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 464; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 465; 466; SSE2-LABEL: 'var_ctlz_v16i32' 467; SSE2-NEXT: Cost Model: Found an estimated cost of 152 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 468; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 469; 470; SSE42-LABEL: 'var_ctlz_v16i32' 471; SSE42-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 472; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 473; 474; AVX1-LABEL: 'var_ctlz_v16i32' 475; AVX1-NEXT: Cost Model: Found an estimated cost of 78 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 476; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 477; 478; AVX2-LABEL: 'var_ctlz_v16i32' 479; AVX2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 480; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 481; 482; AVX512F-LABEL: 'var_ctlz_v16i32' 483; AVX512F-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 484; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 485; 486; AVX512BW-LABEL: 'var_ctlz_v16i32' 487; AVX512BW-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 488; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 489; 490; AVX512CD-LABEL: 'var_ctlz_v16i32' 491; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) 492; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 493; 494 %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 0) 495 ret <16 x i32> %ctlz 496} 497 498define <16 x i32> @var_ctlz_v16i32u(<16 x i32> %a) { 499; NOLZCNT-LABEL: 'var_ctlz_v16i32u' 500; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 152 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 501; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 502; 503; SSE2-LABEL: 'var_ctlz_v16i32u' 504; SSE2-NEXT: Cost Model: Found an estimated cost of 152 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 505; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 506; 507; SSE42-LABEL: 'var_ctlz_v16i32u' 508; SSE42-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 509; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 510; 511; AVX1-LABEL: 'var_ctlz_v16i32u' 512; AVX1-NEXT: Cost Model: Found an estimated cost of 78 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 513; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 514; 515; AVX2-LABEL: 'var_ctlz_v16i32u' 516; AVX2-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 517; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 518; 519; AVX512F-LABEL: 'var_ctlz_v16i32u' 520; AVX512F-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 521; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 522; 523; AVX512BW-LABEL: 'var_ctlz_v16i32u' 524; AVX512BW-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 525; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 526; 527; AVX512CD-LABEL: 'var_ctlz_v16i32u' 528; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) 529; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i32> %ctlz 530; 531 %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 1) 532 ret <16 x i32> %ctlz 533} 534 535define <8 x i16> @var_ctlz_v8i16(<8 x i16> %a) { 536; NOLZCNT-LABEL: 'var_ctlz_v8i16' 537; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 538; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 539; 540; SSE2-LABEL: 'var_ctlz_v8i16' 541; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 542; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 543; 544; SSE42-LABEL: 'var_ctlz_v8i16' 545; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 546; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 547; 548; AVX-LABEL: 'var_ctlz_v8i16' 549; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 550; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 551; 552; AVX512-LABEL: 'var_ctlz_v8i16' 553; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 554; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 555; 556; AVX512CD-LABEL: 'var_ctlz_v8i16' 557; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) 558; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 559; 560 %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 0) 561 ret <8 x i16> %ctlz 562} 563 564define <8 x i16> @var_ctlz_v8i16u(<8 x i16> %a) { 565; NOLZCNT-LABEL: 'var_ctlz_v8i16u' 566; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 567; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 568; 569; SSE2-LABEL: 'var_ctlz_v8i16u' 570; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 571; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 572; 573; SSE42-LABEL: 'var_ctlz_v8i16u' 574; SSE42-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 575; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 576; 577; AVX-LABEL: 'var_ctlz_v8i16u' 578; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 579; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 580; 581; AVX512-LABEL: 'var_ctlz_v8i16u' 582; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 583; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 584; 585; AVX512CD-LABEL: 'var_ctlz_v8i16u' 586; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) 587; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %ctlz 588; 589 %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 1) 590 ret <8 x i16> %ctlz 591} 592 593define <16 x i16> @var_ctlz_v16i16(<16 x i16> %a) { 594; NOLZCNT-LABEL: 'var_ctlz_v16i16' 595; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 596; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 597; 598; SSE2-LABEL: 'var_ctlz_v16i16' 599; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 600; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 601; 602; SSE42-LABEL: 'var_ctlz_v16i16' 603; SSE42-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 604; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 605; 606; AVX1-LABEL: 'var_ctlz_v16i16' 607; AVX1-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 608; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 609; 610; AVX2-LABEL: 'var_ctlz_v16i16' 611; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 612; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 613; 614; AVX512-LABEL: 'var_ctlz_v16i16' 615; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 616; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 617; 618; AVX512CD-LABEL: 'var_ctlz_v16i16' 619; AVX512CD-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) 620; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 621; 622 %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 0) 623 ret <16 x i16> %ctlz 624} 625 626define <16 x i16> @var_ctlz_v16i16u(<16 x i16> %a) { 627; NOLZCNT-LABEL: 'var_ctlz_v16i16u' 628; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 629; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 630; 631; SSE2-LABEL: 'var_ctlz_v16i16u' 632; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 633; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 634; 635; SSE42-LABEL: 'var_ctlz_v16i16u' 636; SSE42-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 637; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 638; 639; AVX1-LABEL: 'var_ctlz_v16i16u' 640; AVX1-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 641; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 642; 643; AVX2-LABEL: 'var_ctlz_v16i16u' 644; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 645; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 646; 647; AVX512-LABEL: 'var_ctlz_v16i16u' 648; AVX512-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 649; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 650; 651; AVX512CD-LABEL: 'var_ctlz_v16i16u' 652; AVX512CD-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) 653; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %ctlz 654; 655 %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 1) 656 ret <16 x i16> %ctlz 657} 658 659define <32 x i16> @var_ctlz_v32i16(<32 x i16> %a) { 660; NOLZCNT-LABEL: 'var_ctlz_v32i16' 661; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 662; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 663; 664; SSE2-LABEL: 'var_ctlz_v32i16' 665; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 666; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 667; 668; SSE42-LABEL: 'var_ctlz_v32i16' 669; SSE42-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 670; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 671; 672; AVX1-LABEL: 'var_ctlz_v32i16' 673; AVX1-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 674; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 675; 676; AVX2-LABEL: 'var_ctlz_v32i16' 677; AVX2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 678; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 679; 680; AVX512F-LABEL: 'var_ctlz_v32i16' 681; AVX512F-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 682; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 683; 684; AVX512BW-LABEL: 'var_ctlz_v32i16' 685; AVX512BW-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 686; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 687; 688; AVX512CD-LABEL: 'var_ctlz_v32i16' 689; AVX512CD-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) 690; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 691; 692 %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 0) 693 ret <32 x i16> %ctlz 694} 695 696define <32 x i16> @var_ctlz_v32i16u(<32 x i16> %a) { 697; NOLZCNT-LABEL: 'var_ctlz_v32i16u' 698; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 699; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 700; 701; SSE2-LABEL: 'var_ctlz_v32i16u' 702; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 703; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 704; 705; SSE42-LABEL: 'var_ctlz_v32i16u' 706; SSE42-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 707; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 708; 709; AVX1-LABEL: 'var_ctlz_v32i16u' 710; AVX1-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 711; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 712; 713; AVX2-LABEL: 'var_ctlz_v32i16u' 714; AVX2-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 715; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 716; 717; AVX512F-LABEL: 'var_ctlz_v32i16u' 718; AVX512F-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 719; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 720; 721; AVX512BW-LABEL: 'var_ctlz_v32i16u' 722; AVX512BW-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 723; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 724; 725; AVX512CD-LABEL: 'var_ctlz_v32i16u' 726; AVX512CD-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) 727; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i16> %ctlz 728; 729 %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 1) 730 ret <32 x i16> %ctlz 731} 732 733define <16 x i8> @var_ctlz_v16i8(<16 x i8> %a) { 734; NOLZCNT-LABEL: 'var_ctlz_v16i8' 735; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 736; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 737; 738; SSE2-LABEL: 'var_ctlz_v16i8' 739; SSE2-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 740; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 741; 742; SSE42-LABEL: 'var_ctlz_v16i8' 743; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 744; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 745; 746; AVX-LABEL: 'var_ctlz_v16i8' 747; AVX-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 748; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 749; 750; AVX512-LABEL: 'var_ctlz_v16i8' 751; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 752; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 753; 754; AVX512CD-LABEL: 'var_ctlz_v16i8' 755; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) 756; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 757; 758 %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 0) 759 ret <16 x i8> %ctlz 760} 761 762define <16 x i8> @var_ctlz_v16i8u(<16 x i8> %a) { 763; NOLZCNT-LABEL: 'var_ctlz_v16i8u' 764; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 765; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 766; 767; SSE2-LABEL: 'var_ctlz_v16i8u' 768; SSE2-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 769; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 770; 771; SSE42-LABEL: 'var_ctlz_v16i8u' 772; SSE42-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 773; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 774; 775; AVX-LABEL: 'var_ctlz_v16i8u' 776; AVX-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 777; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 778; 779; AVX512-LABEL: 'var_ctlz_v16i8u' 780; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 781; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 782; 783; AVX512CD-LABEL: 'var_ctlz_v16i8u' 784; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) 785; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %ctlz 786; 787 %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 1) 788 ret <16 x i8> %ctlz 789} 790 791define <32 x i8> @var_ctlz_v32i8(<32 x i8> %a) { 792; NOLZCNT-LABEL: 'var_ctlz_v32i8' 793; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 794; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 795; 796; SSE2-LABEL: 'var_ctlz_v32i8' 797; SSE2-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 798; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 799; 800; SSE42-LABEL: 'var_ctlz_v32i8' 801; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 802; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 803; 804; AVX1-LABEL: 'var_ctlz_v32i8' 805; AVX1-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 806; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 807; 808; AVX2-LABEL: 'var_ctlz_v32i8' 809; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 810; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 811; 812; AVX512-LABEL: 'var_ctlz_v32i8' 813; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 814; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 815; 816; AVX512CD-LABEL: 'var_ctlz_v32i8' 817; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) 818; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 819; 820 %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 0) 821 ret <32 x i8> %ctlz 822} 823 824define <32 x i8> @var_ctlz_v32i8u(<32 x i8> %a) { 825; NOLZCNT-LABEL: 'var_ctlz_v32i8u' 826; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 827; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 828; 829; SSE2-LABEL: 'var_ctlz_v32i8u' 830; SSE2-NEXT: Cost Model: Found an estimated cost of 58 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 831; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 832; 833; SSE42-LABEL: 'var_ctlz_v32i8u' 834; SSE42-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 835; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 836; 837; AVX1-LABEL: 'var_ctlz_v32i8u' 838; AVX1-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 839; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 840; 841; AVX2-LABEL: 'var_ctlz_v32i8u' 842; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 843; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 844; 845; AVX512-LABEL: 'var_ctlz_v32i8u' 846; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 847; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 848; 849; AVX512CD-LABEL: 'var_ctlz_v32i8u' 850; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) 851; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %ctlz 852; 853 %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 1) 854 ret <32 x i8> %ctlz 855} 856 857define <64 x i8> @var_ctlz_v64i8(<64 x i8> %a) { 858; NOLZCNT-LABEL: 'var_ctlz_v64i8' 859; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 116 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 860; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 861; 862; SSE2-LABEL: 'var_ctlz_v64i8' 863; SSE2-NEXT: Cost Model: Found an estimated cost of 116 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 864; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 865; 866; SSE42-LABEL: 'var_ctlz_v64i8' 867; SSE42-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 868; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 869; 870; AVX1-LABEL: 'var_ctlz_v64i8' 871; AVX1-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 872; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 873; 874; AVX2-LABEL: 'var_ctlz_v64i8' 875; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 876; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 877; 878; AVX512F-LABEL: 'var_ctlz_v64i8' 879; AVX512F-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 880; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 881; 882; AVX512BW-LABEL: 'var_ctlz_v64i8' 883; AVX512BW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 884; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 885; 886; AVX512CD-LABEL: 'var_ctlz_v64i8' 887; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) 888; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 889; 890 %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 0) 891 ret <64 x i8> %ctlz 892} 893 894define <64 x i8> @var_ctlz_v64i8u(<64 x i8> %a) { 895; NOLZCNT-LABEL: 'var_ctlz_v64i8u' 896; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 116 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 897; NOLZCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 898; 899; SSE2-LABEL: 'var_ctlz_v64i8u' 900; SSE2-NEXT: Cost Model: Found an estimated cost of 116 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 901; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 902; 903; SSE42-LABEL: 'var_ctlz_v64i8u' 904; SSE42-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 905; SSE42-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 906; 907; AVX1-LABEL: 'var_ctlz_v64i8u' 908; AVX1-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 909; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 910; 911; AVX2-LABEL: 'var_ctlz_v64i8u' 912; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 913; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 914; 915; AVX512F-LABEL: 'var_ctlz_v64i8u' 916; AVX512F-NEXT: Cost Model: Found an estimated cost of 19 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 917; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 918; 919; AVX512BW-LABEL: 'var_ctlz_v64i8u' 920; AVX512BW-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 921; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 922; 923; AVX512CD-LABEL: 'var_ctlz_v64i8u' 924; AVX512CD-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) 925; AVX512CD-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <64 x i8> %ctlz 926; 927 %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 1) 928 ret <64 x i8> %ctlz 929} 930;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: 931; CHECK: {{.*}} 932