Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
      2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2
      3 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse4.2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE42
      4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx | FileCheck %s -check-prefixes=CHECK,AVX,AVX1
      5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx2 | FileCheck %s -check-prefixes=CHECK,AVX,AVX2
      6 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512F
      7 ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512BW
      8 
      9 ; Verify the cost of scalar trailing zero count instructions.
     10 
     11 declare i64 @llvm.cttz.i64(i64, i1)
     12 declare i32 @llvm.cttz.i32(i32, i1)
     13 declare i16 @llvm.cttz.i16(i16, i1)
     14 declare  i8 @llvm.cttz.i8(i8, i1)
     15 
     16 define i64 @var_cttz_i64(i64 %a) {
     17 ; CHECK-LABEL: 'var_cttz_i64'
     18 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false)
     19 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
     20 ;
     21   %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 0)
     22   ret i64 %cttz
     23 }
     24 
     25 define i64 @var_cttz_i64u(i64 %a) {
     26 ; CHECK-LABEL: 'var_cttz_i64u'
     27 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true)
     28 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz
     29 ;
     30   %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 1)
     31   ret i64 %cttz
     32 }
     33 
     34 define i32 @var_cttz_i32(i32 %a) {
     35 ; CHECK-LABEL: 'var_cttz_i32'
     36 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false)
     37 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
     38 ;
     39   %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 0)
     40   ret i32 %cttz
     41 }
     42 
     43 define i32 @var_cttz_i32u(i32 %a) {
     44 ; CHECK-LABEL: 'var_cttz_i32u'
     45 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true)
     46 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz
     47 ;
     48   %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 1)
     49   ret i32 %cttz
     50 }
     51 
     52 define i16 @var_cttz_i16(i16 %a) {
     53 ; CHECK-LABEL: 'var_cttz_i16'
     54 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false)
     55 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
     56 ;
     57   %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 0)
     58   ret i16 %cttz
     59 }
     60 
     61 define i16 @var_cttz_i16u(i16 %a) {
     62 ; CHECK-LABEL: 'var_cttz_i16u'
     63 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true)
     64 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz
     65 ;
     66   %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 1)
     67   ret i16 %cttz
     68 }
     69 
     70 define i8 @var_cttz_i8(i8 %a) {
     71 ; CHECK-LABEL: 'var_cttz_i8'
     72 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false)
     73 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
     74 ;
     75   %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 0)
     76   ret i8 %cttz
     77 }
     78 
     79 define i8 @var_cttz_i8u(i8 %a) {
     80 ; CHECK-LABEL: 'var_cttz_i8u'
     81 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true)
     82 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz
     83 ;
     84   %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 1)
     85   ret i8 %cttz
     86 }
     87 
     88 ; Verify the cost of vector trailing zero count instructions.
     89 
     90 declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1)
     91 declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1)
     92 declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1)
     93 declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1)
     94 
     95 declare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1)
     96 declare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1)
     97 declare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1)
     98 declare <32 x i8> @llvm.cttz.v32i8(<32 x i8>, i1)
     99 
    100 declare <8 x i64> @llvm.cttz.v8i64(<8 x i64>, i1)
    101 declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1)
    102 declare <32 x i16> @llvm.cttz.v32i16(<32 x i16>, i1)
    103 declare <64 x i8> @llvm.cttz.v64i8(<64 x i8>, i1)
    104 
    105 define <2 x i64> @var_cttz_v2i64(<2 x i64> %a) {
    106 ; SSE2-LABEL: 'var_cttz_v2i64'
    107 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
    108 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    109 ;
    110 ; SSE42-LABEL: 'var_cttz_v2i64'
    111 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
    112 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    113 ;
    114 ; AVX-LABEL: 'var_cttz_v2i64'
    115 ; AVX-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
    116 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    117 ;
    118 ; AVX512-LABEL: 'var_cttz_v2i64'
    119 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 false)
    120 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    121 ;
    122   %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0)
    123   ret <2 x i64> %cttz
    124 }
    125 
    126 define <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) {
    127 ; SSE2-LABEL: 'var_cttz_v2i64u'
    128 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
    129 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    130 ;
    131 ; SSE42-LABEL: 'var_cttz_v2i64u'
    132 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
    133 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    134 ;
    135 ; AVX-LABEL: 'var_cttz_v2i64u'
    136 ; AVX-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
    137 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    138 ;
    139 ; AVX512-LABEL: 'var_cttz_v2i64u'
    140 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 true)
    141 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz
    142 ;
    143   %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1)
    144   ret <2 x i64> %cttz
    145 }
    146 
    147 define <4 x i64> @var_cttz_v4i64(<4 x i64> %a) {
    148 ; SSE2-LABEL: 'var_cttz_v4i64'
    149 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
    150 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    151 ;
    152 ; SSE42-LABEL: 'var_cttz_v4i64'
    153 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
    154 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    155 ;
    156 ; AVX1-LABEL: 'var_cttz_v4i64'
    157 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
    158 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    159 ;
    160 ; AVX2-LABEL: 'var_cttz_v4i64'
    161 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
    162 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    163 ;
    164 ; AVX512-LABEL: 'var_cttz_v4i64'
    165 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 false)
    166 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    167 ;
    168   %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0)
    169   ret <4 x i64> %cttz
    170 }
    171 
    172 define <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) {
    173 ; SSE2-LABEL: 'var_cttz_v4i64u'
    174 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
    175 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    176 ;
    177 ; SSE42-LABEL: 'var_cttz_v4i64u'
    178 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
    179 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    180 ;
    181 ; AVX1-LABEL: 'var_cttz_v4i64u'
    182 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
    183 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    184 ;
    185 ; AVX2-LABEL: 'var_cttz_v4i64u'
    186 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
    187 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    188 ;
    189 ; AVX512-LABEL: 'var_cttz_v4i64u'
    190 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 true)
    191 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz
    192 ;
    193   %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1)
    194   ret <4 x i64> %cttz
    195 }
    196 
    197 define <8 x i64> @var_cttz_v8i64(<8 x i64> %a) {
    198 ; SSE2-LABEL: 'var_cttz_v8i64'
    199 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    200 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    201 ;
    202 ; SSE42-LABEL: 'var_cttz_v8i64'
    203 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    204 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    205 ;
    206 ; AVX1-LABEL: 'var_cttz_v8i64'
    207 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    208 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    209 ;
    210 ; AVX2-LABEL: 'var_cttz_v8i64'
    211 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    212 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    213 ;
    214 ; AVX512F-LABEL: 'var_cttz_v8i64'
    215 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    216 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    217 ;
    218 ; AVX512BW-LABEL: 'var_cttz_v8i64'
    219 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 false)
    220 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    221 ;
    222   %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 0)
    223   ret <8 x i64> %cttz
    224 }
    225 
    226 define <8 x i64> @var_cttz_v8i64u(<8 x i64> %a) {
    227 ; SSE2-LABEL: 'var_cttz_v8i64u'
    228 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    229 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    230 ;
    231 ; SSE42-LABEL: 'var_cttz_v8i64u'
    232 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    233 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    234 ;
    235 ; AVX1-LABEL: 'var_cttz_v8i64u'
    236 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    237 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    238 ;
    239 ; AVX2-LABEL: 'var_cttz_v8i64u'
    240 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    241 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    242 ;
    243 ; AVX512F-LABEL: 'var_cttz_v8i64u'
    244 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    245 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    246 ;
    247 ; AVX512BW-LABEL: 'var_cttz_v8i64u'
    248 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 true)
    249 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz
    250 ;
    251   %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 1)
    252   ret <8 x i64> %cttz
    253 }
    254 
    255 define <4 x i32> @var_cttz_v4i32(<4 x i32> %a) {
    256 ; SSE2-LABEL: 'var_cttz_v4i32'
    257 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
    258 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    259 ;
    260 ; SSE42-LABEL: 'var_cttz_v4i32'
    261 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
    262 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    263 ;
    264 ; AVX-LABEL: 'var_cttz_v4i32'
    265 ; AVX-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
    266 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    267 ;
    268 ; AVX512-LABEL: 'var_cttz_v4i32'
    269 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 false)
    270 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    271 ;
    272   %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0)
    273   ret <4 x i32> %cttz
    274 }
    275 
    276 define <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) {
    277 ; SSE2-LABEL: 'var_cttz_v4i32u'
    278 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
    279 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    280 ;
    281 ; SSE42-LABEL: 'var_cttz_v4i32u'
    282 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
    283 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    284 ;
    285 ; AVX-LABEL: 'var_cttz_v4i32u'
    286 ; AVX-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
    287 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    288 ;
    289 ; AVX512-LABEL: 'var_cttz_v4i32u'
    290 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 true)
    291 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz
    292 ;
    293   %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1)
    294   ret <4 x i32> %cttz
    295 }
    296 
    297 define <8 x i32> @var_cttz_v8i32(<8 x i32> %a) {
    298 ; SSE2-LABEL: 'var_cttz_v8i32'
    299 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
    300 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    301 ;
    302 ; SSE42-LABEL: 'var_cttz_v8i32'
    303 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
    304 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    305 ;
    306 ; AVX1-LABEL: 'var_cttz_v8i32'
    307 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
    308 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    309 ;
    310 ; AVX2-LABEL: 'var_cttz_v8i32'
    311 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
    312 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    313 ;
    314 ; AVX512-LABEL: 'var_cttz_v8i32'
    315 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 false)
    316 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    317 ;
    318   %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0)
    319   ret <8 x i32> %cttz
    320 }
    321 
    322 define <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) {
    323 ; SSE2-LABEL: 'var_cttz_v8i32u'
    324 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
    325 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    326 ;
    327 ; SSE42-LABEL: 'var_cttz_v8i32u'
    328 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
    329 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    330 ;
    331 ; AVX1-LABEL: 'var_cttz_v8i32u'
    332 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
    333 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    334 ;
    335 ; AVX2-LABEL: 'var_cttz_v8i32u'
    336 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
    337 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    338 ;
    339 ; AVX512-LABEL: 'var_cttz_v8i32u'
    340 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 true)
    341 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz
    342 ;
    343   %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1)
    344   ret <8 x i32> %cttz
    345 }
    346 
    347 define <16 x i32> @var_cttz_v16i32(<16 x i32> %a) {
    348 ; SSE2-LABEL: 'var_cttz_v16i32'
    349 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    350 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    351 ;
    352 ; SSE42-LABEL: 'var_cttz_v16i32'
    353 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    354 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    355 ;
    356 ; AVX1-LABEL: 'var_cttz_v16i32'
    357 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    358 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    359 ;
    360 ; AVX2-LABEL: 'var_cttz_v16i32'
    361 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    362 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    363 ;
    364 ; AVX512F-LABEL: 'var_cttz_v16i32'
    365 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    366 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    367 ;
    368 ; AVX512BW-LABEL: 'var_cttz_v16i32'
    369 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 false)
    370 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    371 ;
    372   %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 0)
    373   ret <16 x i32> %cttz
    374 }
    375 
    376 define <16 x i32> @var_cttz_v16i32u(<16 x i32> %a) {
    377 ; SSE2-LABEL: 'var_cttz_v16i32u'
    378 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 72 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    379 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    380 ;
    381 ; SSE42-LABEL: 'var_cttz_v16i32u'
    382 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 56 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    383 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    384 ;
    385 ; AVX1-LABEL: 'var_cttz_v16i32u'
    386 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 60 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    387 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    388 ;
    389 ; AVX2-LABEL: 'var_cttz_v16i32u'
    390 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    391 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    392 ;
    393 ; AVX512F-LABEL: 'var_cttz_v16i32u'
    394 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 28 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    395 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    396 ;
    397 ; AVX512BW-LABEL: 'var_cttz_v16i32u'
    398 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 true)
    399 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz
    400 ;
    401   %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 1)
    402   ret <16 x i32> %cttz
    403 }
    404 
    405 define <8 x i16> @var_cttz_v8i16(<8 x i16> %a) {
    406 ; SSE2-LABEL: 'var_cttz_v8i16'
    407 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
    408 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    409 ;
    410 ; SSE42-LABEL: 'var_cttz_v8i16'
    411 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
    412 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    413 ;
    414 ; AVX-LABEL: 'var_cttz_v8i16'
    415 ; AVX-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
    416 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    417 ;
    418 ; AVX512-LABEL: 'var_cttz_v8i16'
    419 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 false)
    420 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    421 ;
    422   %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0)
    423   ret <8 x i16> %cttz
    424 }
    425 
    426 define <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) {
    427 ; SSE2-LABEL: 'var_cttz_v8i16u'
    428 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
    429 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    430 ;
    431 ; SSE42-LABEL: 'var_cttz_v8i16u'
    432 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
    433 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    434 ;
    435 ; AVX-LABEL: 'var_cttz_v8i16u'
    436 ; AVX-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
    437 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    438 ;
    439 ; AVX512-LABEL: 'var_cttz_v8i16u'
    440 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 true)
    441 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz
    442 ;
    443   %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1)
    444   ret <8 x i16> %cttz
    445 }
    446 
    447 define <16 x i16> @var_cttz_v16i16(<16 x i16> %a) {
    448 ; SSE2-LABEL: 'var_cttz_v16i16'
    449 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
    450 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    451 ;
    452 ; SSE42-LABEL: 'var_cttz_v16i16'
    453 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
    454 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    455 ;
    456 ; AVX1-LABEL: 'var_cttz_v16i16'
    457 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
    458 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    459 ;
    460 ; AVX2-LABEL: 'var_cttz_v16i16'
    461 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
    462 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    463 ;
    464 ; AVX512-LABEL: 'var_cttz_v16i16'
    465 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 false)
    466 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    467 ;
    468   %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0)
    469   ret <16 x i16> %cttz
    470 }
    471 
    472 define <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) {
    473 ; SSE2-LABEL: 'var_cttz_v16i16u'
    474 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 32 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
    475 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    476 ;
    477 ; SSE42-LABEL: 'var_cttz_v16i16u'
    478 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
    479 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    480 ;
    481 ; AVX1-LABEL: 'var_cttz_v16i16u'
    482 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
    483 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    484 ;
    485 ; AVX2-LABEL: 'var_cttz_v16i16u'
    486 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
    487 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    488 ;
    489 ; AVX512-LABEL: 'var_cttz_v16i16u'
    490 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 true)
    491 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz
    492 ;
    493   %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1)
    494   ret <16 x i16> %cttz
    495 }
    496 
    497 define <32 x i16> @var_cttz_v32i16(<32 x i16> %a) {
    498 ; SSE2-LABEL: 'var_cttz_v32i16'
    499 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    500 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    501 ;
    502 ; SSE42-LABEL: 'var_cttz_v32i16'
    503 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    504 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    505 ;
    506 ; AVX1-LABEL: 'var_cttz_v32i16'
    507 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    508 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    509 ;
    510 ; AVX2-LABEL: 'var_cttz_v32i16'
    511 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    512 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    513 ;
    514 ; AVX512F-LABEL: 'var_cttz_v32i16'
    515 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    516 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    517 ;
    518 ; AVX512BW-LABEL: 'var_cttz_v32i16'
    519 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 false)
    520 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    521 ;
    522   %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 0)
    523   ret <32 x i16> %cttz
    524 }
    525 
    526 define <32 x i16> @var_cttz_v32i16u(<32 x i16> %a) {
    527 ; SSE2-LABEL: 'var_cttz_v32i16u'
    528 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 64 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    529 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    530 ;
    531 ; SSE42-LABEL: 'var_cttz_v32i16u'
    532 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    533 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    534 ;
    535 ; AVX1-LABEL: 'var_cttz_v32i16u'
    536 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    537 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    538 ;
    539 ; AVX2-LABEL: 'var_cttz_v32i16u'
    540 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    541 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    542 ;
    543 ; AVX512F-LABEL: 'var_cttz_v32i16u'
    544 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    545 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    546 ;
    547 ; AVX512BW-LABEL: 'var_cttz_v32i16u'
    548 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 true)
    549 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz
    550 ;
    551   %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 1)
    552   ret <32 x i16> %cttz
    553 }
    554 
    555 define <16 x i8> @var_cttz_v16i8(<16 x i8> %a) {
    556 ; SSE2-LABEL: 'var_cttz_v16i8'
    557 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
    558 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    559 ;
    560 ; SSE42-LABEL: 'var_cttz_v16i8'
    561 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
    562 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    563 ;
    564 ; AVX-LABEL: 'var_cttz_v16i8'
    565 ; AVX-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
    566 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    567 ;
    568 ; AVX512-LABEL: 'var_cttz_v16i8'
    569 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 false)
    570 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    571 ;
    572   %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0)
    573   ret <16 x i8> %cttz
    574 }
    575 
    576 define <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) {
    577 ; SSE2-LABEL: 'var_cttz_v16i8u'
    578 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
    579 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    580 ;
    581 ; SSE42-LABEL: 'var_cttz_v16i8u'
    582 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
    583 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    584 ;
    585 ; AVX-LABEL: 'var_cttz_v16i8u'
    586 ; AVX-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
    587 ; AVX-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    588 ;
    589 ; AVX512-LABEL: 'var_cttz_v16i8u'
    590 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 true)
    591 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz
    592 ;
    593   %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1)
    594   ret <16 x i8> %cttz
    595 }
    596 
    597 define <32 x i8> @var_cttz_v32i8(<32 x i8> %a) {
    598 ; SSE2-LABEL: 'var_cttz_v32i8'
    599 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
    600 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    601 ;
    602 ; SSE42-LABEL: 'var_cttz_v32i8'
    603 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
    604 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    605 ;
    606 ; AVX1-LABEL: 'var_cttz_v32i8'
    607 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
    608 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    609 ;
    610 ; AVX2-LABEL: 'var_cttz_v32i8'
    611 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
    612 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    613 ;
    614 ; AVX512-LABEL: 'var_cttz_v32i8'
    615 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 false)
    616 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    617 ;
    618   %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0)
    619   ret <32 x i8> %cttz
    620 }
    621 
    622 define <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) {
    623 ; SSE2-LABEL: 'var_cttz_v32i8u'
    624 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 26 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
    625 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    626 ;
    627 ; SSE42-LABEL: 'var_cttz_v32i8u'
    628 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
    629 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    630 ;
    631 ; AVX1-LABEL: 'var_cttz_v32i8u'
    632 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 20 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
    633 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    634 ;
    635 ; AVX2-LABEL: 'var_cttz_v32i8u'
    636 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
    637 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    638 ;
    639 ; AVX512-LABEL: 'var_cttz_v32i8u'
    640 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 true)
    641 ; AVX512-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz
    642 ;
    643   %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 1)
    644   ret <32 x i8> %cttz
    645 }
    646 
    647 define <64 x i8> @var_cttz_v64i8(<64 x i8> %a) {
    648 ; SSE2-LABEL: 'var_cttz_v64i8'
    649 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    650 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    651 ;
    652 ; SSE42-LABEL: 'var_cttz_v64i8'
    653 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    654 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    655 ;
    656 ; AVX1-LABEL: 'var_cttz_v64i8'
    657 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    658 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    659 ;
    660 ; AVX2-LABEL: 'var_cttz_v64i8'
    661 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    662 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    663 ;
    664 ; AVX512F-LABEL: 'var_cttz_v64i8'
    665 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    666 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    667 ;
    668 ; AVX512BW-LABEL: 'var_cttz_v64i8'
    669 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 false)
    670 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    671 ;
    672   %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 0)
    673   ret <64 x i8> %cttz
    674 }
    675 
    676 define <64 x i8> @var_cttz_v64i8u(<64 x i8> %a) {
    677 ; SSE2-LABEL: 'var_cttz_v64i8u'
    678 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 52 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    679 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    680 ;
    681 ; SSE42-LABEL: 'var_cttz_v64i8u'
    682 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 36 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    683 ; SSE42-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    684 ;
    685 ; AVX1-LABEL: 'var_cttz_v64i8u'
    686 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    687 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    688 ;
    689 ; AVX2-LABEL: 'var_cttz_v64i8u'
    690 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    691 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    692 ;
    693 ; AVX512F-LABEL: 'var_cttz_v64i8u'
    694 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 18 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    695 ; AVX512F-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    696 ;
    697 ; AVX512BW-LABEL: 'var_cttz_v64i8u'
    698 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 true)
    699 ; AVX512BW-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz
    700 ;
    701   %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 1)
    702   ret <64 x i8> %cttz
    703 }
    704