From b41985cc636be6fec6dbb96c2b404dbd0f2a7fec Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 6 Apr 2018 16:14:27 +0000 Subject: [PATCH] [CostModel][X86] Regenerate bit count cost tests with update_analyze_test_checks.py git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329413 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/CostModel/X86/ctlz.ll | 807 ++++++++++++++++++++------- test/Analysis/CostModel/X86/ctpop.ll | 370 +++++++++--- test/Analysis/CostModel/X86/cttz.ll | 685 +++++++++++++++++------ 3 files changed, 1415 insertions(+), 447 deletions(-) diff --git a/test/Analysis/CostModel/X86/ctlz.ll b/test/Analysis/CostModel/X86/ctlz.ll index 9e2d8a53697..e2a6bc5219c 100644 --- a/test/Analysis/CostModel/X86/ctlz.ll +++ b/test/Analysis/CostModel/X86/ctlz.ll @@ -1,10 +1,11 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f -mattr=-avx512cd -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512vl,+avx512bw,+avx512dq -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512BW -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512vl,+avx512bw,+avx512dq,+avx512cd -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512CD +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse4.2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE42 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx | FileCheck %s -check-prefixes=CHECK,AVX,AVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx2 | FileCheck %s -check-prefixes=CHECK,AVX,AVX2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512BW +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,+avx512bw,+avx512dq,+avx512cd | FileCheck %s -check-prefixes=CHECK,AVX512CD ; Verify the cost of scalar leading zero count instructions. @@ -14,57 +15,73 @@ declare i16 @llvm.ctlz.i16(i16, i1) declare i8 @llvm.ctlz.i8(i8, i1) define i64 @var_ctlz_i64(i64 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i64': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz +; %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 0) ret i64 %ctlz } define i64 @var_ctlz_i64u(i64 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i64u': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i64u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctlz +; %ctlz = call i64 @llvm.ctlz.i64(i64 %a, i1 1) ret i64 %ctlz } define i32 @var_ctlz_i32(i32 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i32': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz +; %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 0) ret i32 %ctlz } define i32 @var_ctlz_i32u(i32 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i32u': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i32u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctlz +; %ctlz = call i32 @llvm.ctlz.i32(i32 %a, i1 1) ret i32 %ctlz } define i16 @var_ctlz_i16(i16 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i16': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz +; %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 0) ret i16 %ctlz } define i16 @var_ctlz_i16u(i16 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i16u': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i16u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctlz +; %ctlz = call i16 @llvm.ctlz.i16(i16 %a, i1 1) ret i16 %ctlz } define i8 @var_ctlz_i8(i8 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i8': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i8' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz +; %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 0) ret i8 %ctlz } define i8 @var_ctlz_i8u(i8 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_i8u': -; CHECK: Found an estimated cost of 1 for instruction: %ctlz +; CHECK-LABEL: 'var_ctlz_i8u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctlz +; %ctlz = call i8 @llvm.ctlz.i8(i8 %a, i1 1) ret i8 %ctlz } @@ -87,289 +104,697 @@ declare <32 x i16> @llvm.ctlz.v32i16(<32 x i16>, i1) declare <64 x i8> @llvm.ctlz.v64i8(<64 x i8>, i1) define <2 x i64> @var_ctlz_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v2i64': -; SSE2: Found an estimated cost of 25 for instruction: %ctlz -; SSE42: Found an estimated cost of 23 for instruction: %ctlz -; AVX: Found an estimated cost of 23 for instruction: %ctlz -; AVX512: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v2i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v2i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX-LABEL: 'var_ctlz_v2i64' +; AVX-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 false) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v2i64' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 0) ret <2 x i64> %ctlz } define <2 x i64> @var_ctlz_v2i64u(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v2i64u': -; SSE2: Found an estimated cost of 25 for instruction: %ctlz -; SSE42: Found an estimated cost of 23 for instruction: %ctlz -; AVX: Found an estimated cost of 23 for instruction: %ctlz -; AVX512: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v2i64u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 25 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v2i64u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX-LABEL: 'var_ctlz_v2i64u' +; AVX-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v2i64u' +; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 true) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v2i64u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctlz +; %ctlz = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a, i1 1) ret <2 x i64> %ctlz } define <4 x i64> @var_ctlz_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i64': -; SSE2: Found an estimated cost of 50 for instruction: %ctlz -; SSE42: Found an estimated cost of 46 for instruction: %ctlz -; AVX1: Found an estimated cost of 48 for instruction: %ctlz -; AVX2: Found an estimated cost of 23 for instruction: %ctlz -; AVX512: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v4i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v4i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v4i64' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 0) ret <4 x i64> %ctlz } define <4 x i64> @var_ctlz_v4i64u(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i64u': -; SSE2: Found an estimated cost of 50 for instruction: %ctlz -; SSE42: Found an estimated cost of 46 for instruction: %ctlz -; AVX1: Found an estimated cost of 48 for instruction: %ctlz -; AVX2: Found an estimated cost of 23 for instruction: %ctlz -; AVX512: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v4i64u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v4i64u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v4i64u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v4i64u' +; AVX2-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v4i64u' +; AVX512-NEXT: Cost Model: Found an estimated cost of 23 for instruction: %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 true) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v4i64u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctlz +; %ctlz = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 1) ret <4 x i64> %ctlz } define <8 x i64> @var_ctlz_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i64': -; SSE2: Found an estimated cost of 100 for instruction: %ctlz -; SSE42: Found an estimated cost of 92 for instruction: %ctlz -; AVX1: Found an estimated cost of 96 for instruction: %ctlz -; AVX2: Found an estimated cost of 46 for instruction: %ctlz -; AVX512F: Found an estimated cost of 29 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v8i64' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 false) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v8i64' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i64' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 0) ret <8 x i64> %ctlz } define <8 x i64> @var_ctlz_v8i64u(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i64u': -; SSE2: Found an estimated cost of 100 for instruction: %ctlz -; SSE42: Found an estimated cost of 92 for instruction: %ctlz -; AVX1: Found an estimated cost of 96 for instruction: %ctlz -; AVX2: Found an estimated cost of 46 for instruction: %ctlz -; AVX512F: Found an estimated cost of 29 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 23 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i64u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i64u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 92 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v8i64u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v8i64u' +; AVX2-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v8i64u' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 29 for instruction: %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 true) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v8i64u' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i64u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctlz +; %ctlz = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> %a, i1 1) ret <8 x i64> %ctlz } define <4 x i32> @var_ctlz_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i32': -; SSE2: Found an estimated cost of 26 for instruction: %ctlz -; SSE42: Found an estimated cost of 18 for instruction: %ctlz -; AVX: Found an estimated cost of 18 for instruction: %ctlz -; AVX512: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v4i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX-LABEL: 'var_ctlz_v4i32' +; AVX-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 false) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v4i32' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 0) ret <4 x i32> %ctlz } define <4 x i32> @var_ctlz_v4i32u(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v4i32u': -; SSE2: Found an estimated cost of 26 for instruction: %ctlz -; SSE42: Found an estimated cost of 18 for instruction: %ctlz -; AVX: Found an estimated cost of 18 for instruction: %ctlz -; AVX512: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v4i32u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v4i32u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX-LABEL: 'var_ctlz_v4i32u' +; AVX-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v4i32u' +; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 true) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v4i32u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctlz +; %ctlz = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %a, i1 1) ret <4 x i32> %ctlz } define <8 x i32> @var_ctlz_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i32': -; SSE2: Found an estimated cost of 52 for instruction: %ctlz -; SSE42: Found an estimated cost of 36 for instruction: %ctlz -; AVX1: Found an estimated cost of 38 for instruction: %ctlz -; AVX2: Found an estimated cost of 18 for instruction: %ctlz -; AVX512: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 false) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i32' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 0) ret <8 x i32> %ctlz } define <8 x i32> @var_ctlz_v8i32u(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i32u': -; SSE2: Found an estimated cost of 52 for instruction: %ctlz -; SSE42: Found an estimated cost of 36 for instruction: %ctlz -; AVX1: Found an estimated cost of 38 for instruction: %ctlz -; AVX2: Found an estimated cost of 18 for instruction: %ctlz -; AVX512: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i32u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i32u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v8i32u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v8i32u' +; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v8i32u' +; AVX512-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 true) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i32u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctlz +; %ctlz = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> %a, i1 1) ret <8 x i32> %ctlz } define <16 x i32> @var_ctlz_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i32': -; SSE2: Found an estimated cost of 104 for instruction: %ctlz -; SSE42: Found an estimated cost of 72 for instruction: %ctlz -; AVX1: Found an estimated cost of 76 for instruction: %ctlz -; AVX2: Found an estimated cost of 36 for instruction: %ctlz -; AVX512F: Found an estimated cost of 35 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 22 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v16i32' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 35 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v16i32' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 false) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i32' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 0) ret <16 x i32> %ctlz } define <16 x i32> @var_ctlz_v16i32u(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i32u': -; SSE2: Found an estimated cost of 104 for instruction: %ctlz -; SSE42: Found an estimated cost of 72 for instruction: %ctlz -; AVX1: Found an estimated cost of 76 for instruction: %ctlz -; AVX2: Found an estimated cost of 36 for instruction: %ctlz -; AVX512F: Found an estimated cost of 35 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 22 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 1 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i32u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i32u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 72 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v16i32u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v16i32u' +; AVX2-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v16i32u' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 35 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v16i32u' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 true) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i32u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctlz +; %ctlz = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %a, i1 1) ret <16 x i32> %ctlz } define <8 x i16> @var_ctlz_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i16': -; SSE2: Found an estimated cost of 20 for instruction: %ctlz -; SSE42: Found an estimated cost of 14 for instruction: %ctlz -; AVX: Found an estimated cost of 14 for instruction: %ctlz -; AVX512: Found an estimated cost of 14 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i16' +; SSE42-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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX-LABEL: 'var_ctlz_v8i16' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v8i16' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i16' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 0) ret <8 x i16> %ctlz } define <8 x i16> @var_ctlz_v8i16u(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v8i16u': -; SSE2: Found an estimated cost of 20 for instruction: %ctlz -; SSE42: Found an estimated cost of 14 for instruction: %ctlz -; AVX: Found an estimated cost of 14 for instruction: %ctlz -; AVX512: Found an estimated cost of 14 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v8i16u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v8i16u' +; SSE42-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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX-LABEL: 'var_ctlz_v8i16u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v8i16u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v8i16u' +; 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) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctlz +; %ctlz = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 1) ret <8 x i16> %ctlz } define <16 x i16> @var_ctlz_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i16': -; SSE2: Found an estimated cost of 40 for instruction: %ctlz -; SSE42: Found an estimated cost of 28 for instruction: %ctlz -; AVX1: Found an estimated cost of 30 for instruction: %ctlz -; AVX2: Found an estimated cost of 14 for instruction: %ctlz -; AVX512: Found an estimated cost of 14 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i16' +; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v16i16' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v16i16' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i16' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 false) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 0) ret <16 x i16> %ctlz } define <16 x i16> @var_ctlz_v16i16u(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i16u': -; SSE2: Found an estimated cost of 40 for instruction: %ctlz -; SSE42: Found an estimated cost of 28 for instruction: %ctlz -; AVX1: Found an estimated cost of 30 for instruction: %ctlz -; AVX2: Found an estimated cost of 14 for instruction: %ctlz -; AVX512: Found an estimated cost of 14 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i16u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i16u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v16i16u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v16i16u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v16i16u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i16u' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 true) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctlz +; %ctlz = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> %a, i1 1) ret <16 x i16> %ctlz } define <32 x i16> @var_ctlz_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i16': -; SSE2: Found an estimated cost of 80 for instruction: %ctlz -; SSE42: Found an estimated cost of 56 for instruction: %ctlz -; AVX1: Found an estimated cost of 60 for instruction: %ctlz -; AVX2: Found an estimated cost of 28 for instruction: %ctlz -; AVX512F: Found an estimated cost of 28 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 8 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 80 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v32i16' +; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v32i16' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v32i16' +; AVX512F-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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v32i16' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 false) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 0) ret <32 x i16> %ctlz } define <32 x i16> @var_ctlz_v32i16u(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i16u': -; SSE2: Found an estimated cost of 80 for instruction: %ctlz -; SSE42: Found an estimated cost of 56 for instruction: %ctlz -; AVX1: Found an estimated cost of 60 for instruction: %ctlz -; AVX2: Found an estimated cost of 28 for instruction: %ctlz -; AVX512F: Found an estimated cost of 28 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 18 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 8 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v32i16u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 80 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v32i16u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v32i16u' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v32i16u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v32i16u' +; AVX512F-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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v32i16u' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v32i16u' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 true) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctlz +; %ctlz = call <32 x i16> @llvm.ctlz.v32i16(<32 x i16> %a, i1 1) ret <32 x i16> %ctlz } define <16 x i8> @var_ctlz_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i8': -; SSE2: Found an estimated cost of 17 for instruction: %ctlz -; SSE42: Found an estimated cost of 9 for instruction: %ctlz -; AVX: Found an estimated cost of 9 for instruction: %ctlz -; AVX512: Found an estimated cost of 9 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i8' +; SSE42-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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX-LABEL: 'var_ctlz_v16i8' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v16i8' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i8' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 false) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 0) ret <16 x i8> %ctlz } define <16 x i8> @var_ctlz_v16i8u(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v16i8u': -; SSE2: Found an estimated cost of 17 for instruction: %ctlz -; SSE42: Found an estimated cost of 9 for instruction: %ctlz -; AVX: Found an estimated cost of 9 for instruction: %ctlz -; AVX512: Found an estimated cost of 9 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 4 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v16i8u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v16i8u' +; SSE42-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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX-LABEL: 'var_ctlz_v16i8u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v16i8u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v16i8u' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 true) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctlz +; %ctlz = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %a, i1 1) ret <16 x i8> %ctlz } define <32 x i8> @var_ctlz_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i8': -; SSE2: Found an estimated cost of 34 for instruction: %ctlz -; SSE42: Found an estimated cost of 18 for instruction: %ctlz -; AVX1: Found an estimated cost of 20 for instruction: %ctlz -; AVX2: Found an estimated cost of 9 for instruction: %ctlz -; AVX512: Found an estimated cost of 9 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 10 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v32i8' +; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v32i8' +; AVX1-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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v32i8' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v32i8' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v32i8' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 0) ret <32 x i8> %ctlz } define <32 x i8> @var_ctlz_v32i8u(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v32i8u': -; SSE2: Found an estimated cost of 34 for instruction: %ctlz -; SSE42: Found an estimated cost of 18 for instruction: %ctlz -; AVX1: Found an estimated cost of 20 for instruction: %ctlz -; AVX2: Found an estimated cost of 9 for instruction: %ctlz -; AVX512: Found an estimated cost of 9 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 10 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v32i8u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v32i8u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v32i8u' +; AVX1-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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v32i8u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX512-LABEL: 'var_ctlz_v32i8u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v32i8u' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 true) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctlz +; %ctlz = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 1) ret <32 x i8> %ctlz } define <64 x i8> @var_ctlz_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v64i8': -; SSE2: Found an estimated cost of 68 for instruction: %ctlz -; SSE42: Found an estimated cost of 36 for instruction: %ctlz -; AVX1: Found an estimated cost of 40 for instruction: %ctlz -; AVX2: Found an estimated cost of 18 for instruction: %ctlz -; AVX512F: Found an estimated cost of 18 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 17 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 20 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v64i8' +; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v64i8' +; AVX1-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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v64i8' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v64i8' +; AVX512F-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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v64i8' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 false) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 0) ret <64 x i8> %ctlz } define <64 x i8> @var_ctlz_v64i8u(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctlz_v64i8u': -; SSE2: Found an estimated cost of 68 for instruction: %ctlz -; SSE42: Found an estimated cost of 36 for instruction: %ctlz -; AVX1: Found an estimated cost of 40 for instruction: %ctlz -; AVX2: Found an estimated cost of 18 for instruction: %ctlz -; AVX512F: Found an estimated cost of 18 for instruction: %ctlz -; AVX512BW: Found an estimated cost of 17 for instruction: %ctlz -; AVX512CD: Found an estimated cost of 20 for instruction: %ctlz +; SSE2-LABEL: 'var_ctlz_v64i8u' +; SSE2-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; SSE42-LABEL: 'var_ctlz_v64i8u' +; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX1-LABEL: 'var_ctlz_v64i8u' +; AVX1-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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX2-LABEL: 'var_ctlz_v64i8u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512F-LABEL: 'var_ctlz_v64i8u' +; AVX512F-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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512BW-LABEL: 'var_ctlz_v64i8u' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; +; AVX512CD-LABEL: 'var_ctlz_v64i8u' +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 true) +; AVX512CD-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctlz +; %ctlz = call <64 x i8> @llvm.ctlz.v64i8(<64 x i8> %a, i1 1) ret <64 x i8> %ctlz } diff --git a/test/Analysis/CostModel/X86/ctpop.ll b/test/Analysis/CostModel/X86/ctpop.ll index 691a231d561..bb59558e458 100644 --- a/test/Analysis/CostModel/X86/ctpop.ll +++ b/test/Analysis/CostModel/X86/ctpop.ll @@ -1,9 +1,11 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2 -check-prefix=NOPOPCNT -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+popcnt,+sse4.2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42 -check-prefix=POPCNT -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+popcnt,+avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1 -check-prefix=POPCNT -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+popcnt,+avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 -check-prefix=POPCNT -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+popcnt,+avx512f -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512F -check-prefix=POPCNT -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+popcnt,+avx512vl,+avx512bw,+avx512dq -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512BW -check-prefix=POPCNT +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=-popcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2,NOPOPCNT +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2,POPCNT +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+sse4.2 | FileCheck %s -check-prefixes=CHECK,POPCNT,SSE,SSE42 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX,AVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx2 | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX,AVX2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx512f | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+popcnt,+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,POPCNT,AVX512,AVX512BW ; Verify the cost of scalar population count instructions. @@ -13,33 +15,53 @@ declare i16 @llvm.ctpop.i16(i16) declare i8 @llvm.ctpop.i8(i8) define i64 @var_ctpop_i64(i64 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_i64': -; NOPOPCNT: Found an estimated cost of 4 for instruction: %ctpop -; POPCNT: Found an estimated cost of 1 for instruction: %ctpop +; NOPOPCNT-LABEL: 'var_ctpop_i64' +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a) +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop +; +; POPCNT-LABEL: 'var_ctpop_i64' +; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i64 @llvm.ctpop.i64(i64 %a) +; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %ctpop +; %ctpop = call i64 @llvm.ctpop.i64(i64 %a) ret i64 %ctpop } define i32 @var_ctpop_i32(i32 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_i32': -; NOPOPCNT: Found an estimated cost of 4 for instruction: %ctpop -; POPCNT: Found an estimated cost of 1 for instruction: %ctpop +; NOPOPCNT-LABEL: 'var_ctpop_i32' +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a) +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop +; +; POPCNT-LABEL: 'var_ctpop_i32' +; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i32 @llvm.ctpop.i32(i32 %a) +; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %ctpop +; %ctpop = call i32 @llvm.ctpop.i32(i32 %a) ret i32 %ctpop } define i16 @var_ctpop_i16(i16 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_i16': -; NOPOPCNT: Found an estimated cost of 4 for instruction: %ctpop -; POPCNT: Found an estimated cost of 1 for instruction: %ctpop +; NOPOPCNT-LABEL: 'var_ctpop_i16' +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a) +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop +; +; POPCNT-LABEL: 'var_ctpop_i16' +; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i16 @llvm.ctpop.i16(i16 %a) +; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %ctpop +; %ctpop = call i16 @llvm.ctpop.i16(i16 %a) ret i16 %ctpop } define i8 @var_ctpop_i8(i8 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_i8': -; NOPOPCNT: Found an estimated cost of 4 for instruction: %ctpop -; POPCNT: Found an estimated cost of 1 for instruction: %ctpop +; NOPOPCNT-LABEL: 'var_ctpop_i8' +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a) +; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop +; +; POPCNT-LABEL: 'var_ctpop_i8' +; POPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a) +; POPCNT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %ctpop +; %ctpop = call i8 @llvm.ctpop.i8(i8 %a) ret i8 %ctpop } @@ -62,133 +84,301 @@ declare <32 x i16> @llvm.ctpop.v32i16(<32 x i16>) declare <64 x i8> @llvm.ctpop.v64i8(<64 x i8>) define <2 x i64> @var_ctpop_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v2i64': -; SSE2: Found an estimated cost of 12 for instruction: %ctpop -; SSE42: Found an estimated cost of 7 for instruction: %ctpop -; AVX: Found an estimated cost of 7 for instruction: %ctpop -; AVX512: Found an estimated cost of 7 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v2i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v2i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop +; +; AVX-LABEL: 'var_ctpop_v2i64' +; AVX-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %ctpop +; %ctpop = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a) ret <2 x i64> %ctpop } define <4 x i64> @var_ctpop_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v4i64': -; SSE2: Found an estimated cost of 24 for instruction: %ctpop -; SSE42: Found an estimated cost of 14 for instruction: %ctpop -; AVX1: Found an estimated cost of 16 for instruction: %ctpop -; AVX2: Found an estimated cost of 7 for instruction: %ctpop -; AVX512: Found an estimated cost of 7 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v4i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v4i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %ctpop +; %ctpop = call <4 x i64> @llvm.ctpop.v4i64(<4 x i64> %a) ret <4 x i64> %ctpop } define <8 x i64> @var_ctpop_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v8i64': -; SSE2: Found an estimated cost of 48 for instruction: %ctpop -; SSE42: Found an estimated cost of 28 for instruction: %ctpop -; AVX1: Found an estimated cost of 32 for instruction: %ctpop -; AVX2: Found an estimated cost of 14 for instruction: %ctpop -; AVX512F: Found an estimated cost of 16 for instruction: %ctpop -; AVX512BW: Found an estimated cost of 7 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v8i64' +; SSE2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v8i64' +; SSE42-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; +; AVX512F-LABEL: 'var_ctpop_v8i64' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; +; AVX512BW-LABEL: 'var_ctpop_v8i64' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %ctpop +; %ctpop = call <8 x i64> @llvm.ctpop.v8i64(<8 x i64> %a) ret <8 x i64> %ctpop } define <4 x i32> @var_ctpop_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v4i32': -; SSE2: Found an estimated cost of 15 for instruction: %ctpop -; SSE42: Found an estimated cost of 11 for instruction: %ctpop -; AVX: Found an estimated cost of 11 for instruction: %ctpop -; AVX512: Found an estimated cost of 11 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 15 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v4i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop +; +; AVX-LABEL: 'var_ctpop_v4i32' +; AVX-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %ctpop +; %ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %a) ret <4 x i32> %ctpop } define <8 x i32> @var_ctpop_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v8i32': -; SSE2: Found an estimated cost of 30 for instruction: %ctpop -; SSE42: Found an estimated cost of 22 for instruction: %ctpop -; AVX1: Found an estimated cost of 24 for instruction: %ctpop -; AVX2: Found an estimated cost of 11 for instruction: %ctpop -; AVX512: Found an estimated cost of 11 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v8i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %ctpop +; %ctpop = call <8 x i32> @llvm.ctpop.v8i32(<8 x i32> %a) ret <8 x i32> %ctpop } define <16 x i32> @var_ctpop_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v16i32': -; SSE2: Found an estimated cost of 60 for instruction: %ctpop -; SSE42: Found an estimated cost of 44 for instruction: %ctpop -; AVX1: Found an estimated cost of 48 for instruction: %ctpop -; AVX2: Found an estimated cost of 22 for instruction: %ctpop -; AVX512F: Found an estimated cost of 24 for instruction: %ctpop -; AVX512BW: Found an estimated cost of 11 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v16i32' +; SSE42-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; +; AVX512F-LABEL: 'var_ctpop_v16i32' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; +; AVX512BW-LABEL: 'var_ctpop_v16i32' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %ctpop +; %ctpop = call <16 x i32> @llvm.ctpop.v16i32(<16 x i32> %a) ret <16 x i32> %ctpop } define <8 x i16> @var_ctpop_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v8i16': -; SSE2: Found an estimated cost of 13 for instruction: %ctpop -; SSE42: Found an estimated cost of 9 for instruction: %ctpop -; AVX: Found an estimated cost of 9 for instruction: %ctpop -; AVX512: Found an estimated cost of 9 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v8i16' +; SSE42-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop +; +; AVX-LABEL: 'var_ctpop_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v8i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %ctpop +; %ctpop = call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %a) ret <8 x i16> %ctpop } define <16 x i16> @var_ctpop_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v16i16': -; SSE2: Found an estimated cost of 26 for instruction: %ctpop -; SSE42: Found an estimated cost of 18 for instruction: %ctpop -; AVX1: Found an estimated cost of 20 for instruction: %ctpop -; AVX2: Found an estimated cost of 9 for instruction: %ctpop -; AVX512: Found an estimated cost of 9 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v16i16' +; SSE42-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %ctpop +; %ctpop = call <16 x i16> @llvm.ctpop.v16i16(<16 x i16> %a) ret <16 x i16> %ctpop } define <32 x i16> @var_ctpop_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v32i16': -; SSE2: Found an estimated cost of 52 for instruction: %ctpop -; SSE42: Found an estimated cost of 36 for instruction: %ctpop -; AVX1: Found an estimated cost of 40 for instruction: %ctpop -; AVX2: Found an estimated cost of 18 for instruction: %ctpop -; AVX512F: Found an estimated cost of 18 for instruction: %ctpop -; AVX512BW: Found an estimated cost of 9 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v32i16' +; SSE42-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; +; AVX512F-LABEL: 'var_ctpop_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; +; AVX512BW-LABEL: 'var_ctpop_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %ctpop +; %ctpop = call <32 x i16> @llvm.ctpop.v32i16(<32 x i16> %a) ret <32 x i16> %ctpop } define <16 x i8> @var_ctpop_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v16i8': -; SSE2: Found an estimated cost of 10 for instruction: %ctpop -; SSE42: Found an estimated cost of 6 for instruction: %ctpop -; AVX: Found an estimated cost of 6 for instruction: %ctpop -; AVX512: Found an estimated cost of 6 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v16i8' +; SSE42-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop +; +; AVX-LABEL: 'var_ctpop_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %ctpop +; %ctpop = call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %a) ret <16 x i8> %ctpop } define <32 x i8> @var_ctpop_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v32i8': -; SSE2: Found an estimated cost of 20 for instruction: %ctpop -; SSE42: Found an estimated cost of 12 for instruction: %ctpop -; AVX1: Found an estimated cost of 14 for instruction: %ctpop -; AVX2: Found an estimated cost of 6 for instruction: %ctpop -; AVX512: Found an estimated cost of 6 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v32i8' +; SSE42-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop +; +; AVX512-LABEL: 'var_ctpop_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %ctpop +; %ctpop = call <32 x i8> @llvm.ctpop.v32i8(<32 x i8> %a) ret <32 x i8> %ctpop } define <64 x i8> @var_ctpop_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_ctpop_v64i8': -; SSE2: Found an estimated cost of 40 for instruction: %ctpop -; SSE42: Found an estimated cost of 24 for instruction: %ctpop -; AVX1: Found an estimated cost of 28 for instruction: %ctpop -; AVX2: Found an estimated cost of 12 for instruction: %ctpop -; AVX512F: Found an estimated cost of 12 for instruction: %ctpop -; AVX512BW: Found an estimated cost of 6 for instruction: %ctpop +; SSE2-LABEL: 'var_ctpop_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; +; SSE42-LABEL: 'var_ctpop_v64i8' +; SSE42-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; +; AVX1-LABEL: 'var_ctpop_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; +; AVX2-LABEL: 'var_ctpop_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; +; AVX512F-LABEL: 'var_ctpop_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; +; AVX512BW-LABEL: 'var_ctpop_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %ctpop +; %ctpop = call <64 x i8> @llvm.ctpop.v64i8(<64 x i8> %a) ret <64 x i8> %ctpop } diff --git a/test/Analysis/CostModel/X86/cttz.ll b/test/Analysis/CostModel/X86/cttz.ll index 66b8bac4ff2..f5c818c0ade 100644 --- a/test/Analysis/CostModel/X86/cttz.ll +++ b/test/Analysis/CostModel/X86/cttz.ll @@ -1,9 +1,10 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512vl,+avx512bw,+avx512dq -cost-model -analyze | FileCheck %s -check-prefix=CHECK -check-prefix=AVX512 -check-prefix=AVX512BW +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+sse4.2 | FileCheck %s -check-prefixes=CHECK,SSE,SSE42 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx | FileCheck %s -check-prefixes=CHECK,AVX,AVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx2 | FileCheck %s -check-prefixes=CHECK,AVX,AVX2 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512vl,+avx512bw,+avx512dq | FileCheck %s -check-prefixes=CHECK,AVX512,AVX512BW ; Verify the cost of scalar trailing zero count instructions. @@ -13,57 +14,73 @@ declare i16 @llvm.cttz.i16(i16, i1) declare i8 @llvm.cttz.i8(i8, i1) define i64 @var_cttz_i64(i64 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i64': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz +; %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 0) ret i64 %cttz } define i64 @var_cttz_i64u(i64 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i64u': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i64u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %cttz +; %cttz = call i64 @llvm.cttz.i64(i64 %a, i1 1) ret i64 %cttz } define i32 @var_cttz_i32(i32 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i32': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz +; %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 0) ret i32 %cttz } define i32 @var_cttz_i32u(i32 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i32u': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i32u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %cttz +; %cttz = call i32 @llvm.cttz.i32(i32 %a, i1 1) ret i32 %cttz } define i16 @var_cttz_i16(i16 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i16': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz +; %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 0) ret i16 %cttz } define i16 @var_cttz_i16u(i16 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i16u': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i16u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %cttz +; %cttz = call i16 @llvm.cttz.i16(i16 %a, i1 1) ret i16 %cttz } define i8 @var_cttz_i8(i8 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i8': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i8' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 false) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz +; %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 0) ret i8 %cttz } define i8 @var_cttz_i8u(i8 %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_i8u': -; CHECK: Found an estimated cost of 1 for instruction: %cttz +; CHECK-LABEL: 'var_cttz_i8u' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 true) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %cttz +; %cttz = call i8 @llvm.cttz.i8(i8 %a, i1 1) ret i8 %cttz } @@ -86,265 +103,601 @@ declare <32 x i16> @llvm.cttz.v32i16(<32 x i16>, i1) declare <64 x i8> @llvm.cttz.v64i8(<64 x i8>, i1) define <2 x i64> @var_cttz_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v2i64': -; SSE2: Found an estimated cost of 14 for instruction: %cttz -; SSE42: Found an estimated cost of 10 for instruction: %cttz -; AVX: Found an estimated cost of 10 for instruction: %cttz -; AVX512: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v2i64' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v2i64' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; AVX-LABEL: 'var_cttz_v2i64' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; AVX512-LABEL: 'var_cttz_v2i64' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 0) ret <2 x i64> %cttz } define <2 x i64> @var_cttz_v2i64u(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v2i64u': -; SSE2: Found an estimated cost of 14 for instruction: %cttz -; SSE42: Found an estimated cost of 10 for instruction: %cttz -; AVX: Found an estimated cost of 10 for instruction: %cttz -; AVX512: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v2i64u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v2i64u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; AVX-LABEL: 'var_cttz_v2i64u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; +; AVX512-LABEL: 'var_cttz_v2i64u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %cttz +; %cttz = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a, i1 1) ret <2 x i64> %cttz } define <4 x i64> @var_cttz_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i64': -; SSE2: Found an estimated cost of 28 for instruction: %cttz -; SSE42: Found an estimated cost of 20 for instruction: %cttz -; AVX1: Found an estimated cost of 22 for instruction: %cttz -; AVX2: Found an estimated cost of 10 for instruction: %cttz -; AVX512: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v4i64' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v4i64' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX1-LABEL: 'var_cttz_v4i64' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX2-LABEL: 'var_cttz_v4i64' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX512-LABEL: 'var_cttz_v4i64' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 0) ret <4 x i64> %cttz } define <4 x i64> @var_cttz_v4i64u(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i64u': -; SSE2: Found an estimated cost of 28 for instruction: %cttz -; SSE42: Found an estimated cost of 20 for instruction: %cttz -; AVX1: Found an estimated cost of 22 for instruction: %cttz -; AVX2: Found an estimated cost of 10 for instruction: %cttz -; AVX512: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v4i64u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v4i64u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX1-LABEL: 'var_cttz_v4i64u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX2-LABEL: 'var_cttz_v4i64u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; +; AVX512-LABEL: 'var_cttz_v4i64u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %cttz +; %cttz = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> %a, i1 1) ret <4 x i64> %cttz } define <8 x i64> @var_cttz_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i64': -; SSE2: Found an estimated cost of 56 for instruction: %cttz -; SSE42: Found an estimated cost of 40 for instruction: %cttz -; AVX1: Found an estimated cost of 44 for instruction: %cttz -; AVX2: Found an estimated cost of 20 for instruction: %cttz -; AVX512F: Found an estimated cost of 20 for instruction: %cttz -; AVX512BW: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i64' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i64' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX1-LABEL: 'var_cttz_v8i64' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX2-LABEL: 'var_cttz_v8i64' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX512F-LABEL: 'var_cttz_v8i64' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v8i64' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 0) ret <8 x i64> %cttz } define <8 x i64> @var_cttz_v8i64u(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i64u': -; SSE2: Found an estimated cost of 56 for instruction: %cttz -; SSE42: Found an estimated cost of 40 for instruction: %cttz -; AVX1: Found an estimated cost of 44 for instruction: %cttz -; AVX2: Found an estimated cost of 20 for instruction: %cttz -; AVX512F: Found an estimated cost of 20 for instruction: %cttz -; AVX512BW: Found an estimated cost of 10 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i64u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i64u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX1-LABEL: 'var_cttz_v8i64u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX2-LABEL: 'var_cttz_v8i64u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX512F-LABEL: 'var_cttz_v8i64u' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v8i64u' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %cttz +; %cttz = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> %a, i1 1) ret <8 x i64> %cttz } define <4 x i32> @var_cttz_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i32': -; SSE2: Found an estimated cost of 18 for instruction: %cttz -; SSE42: Found an estimated cost of 14 for instruction: %cttz -; AVX: Found an estimated cost of 14 for instruction: %cttz -; AVX512: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v4i32' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v4i32' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; AVX-LABEL: 'var_cttz_v4i32' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; AVX512-LABEL: 'var_cttz_v4i32' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 0) ret <4 x i32> %cttz } define <4 x i32> @var_cttz_v4i32u(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v4i32u': -; SSE2: Found an estimated cost of 18 for instruction: %cttz -; SSE42: Found an estimated cost of 14 for instruction: %cttz -; AVX: Found an estimated cost of 14 for instruction: %cttz -; AVX512: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v4i32u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v4i32u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; AVX-LABEL: 'var_cttz_v4i32u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; +; AVX512-LABEL: 'var_cttz_v4i32u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %cttz +; %cttz = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> %a, i1 1) ret <4 x i32> %cttz } define <8 x i32> @var_cttz_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i32': -; SSE2: Found an estimated cost of 36 for instruction: %cttz -; SSE42: Found an estimated cost of 28 for instruction: %cttz -; AVX1: Found an estimated cost of 30 for instruction: %cttz -; AVX2: Found an estimated cost of 14 for instruction: %cttz -; AVX512: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i32' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i32' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX1-LABEL: 'var_cttz_v8i32' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX2-LABEL: 'var_cttz_v8i32' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX512-LABEL: 'var_cttz_v8i32' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 0) ret <8 x i32> %cttz } define <8 x i32> @var_cttz_v8i32u(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i32u': -; SSE2: Found an estimated cost of 36 for instruction: %cttz -; SSE42: Found an estimated cost of 28 for instruction: %cttz -; AVX1: Found an estimated cost of 30 for instruction: %cttz -; AVX2: Found an estimated cost of 14 for instruction: %cttz -; AVX512: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i32u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i32u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX1-LABEL: 'var_cttz_v8i32u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX2-LABEL: 'var_cttz_v8i32u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; +; AVX512-LABEL: 'var_cttz_v8i32u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %cttz +; %cttz = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> %a, i1 1) ret <8 x i32> %cttz } define <16 x i32> @var_cttz_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i32': -; SSE2: Found an estimated cost of 72 for instruction: %cttz -; SSE42: Found an estimated cost of 56 for instruction: %cttz -; AVX1: Found an estimated cost of 60 for instruction: %cttz -; AVX2: Found an estimated cost of 28 for instruction: %cttz -; AVX512F: Found an estimated cost of 28 for instruction: %cttz -; AVX512BW: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i32' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i32' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX1-LABEL: 'var_cttz_v16i32' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX2-LABEL: 'var_cttz_v16i32' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX512F-LABEL: 'var_cttz_v16i32' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v16i32' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 0) ret <16 x i32> %cttz } define <16 x i32> @var_cttz_v16i32u(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i32u': -; SSE2: Found an estimated cost of 72 for instruction: %cttz -; SSE42: Found an estimated cost of 56 for instruction: %cttz -; AVX1: Found an estimated cost of 60 for instruction: %cttz -; AVX2: Found an estimated cost of 28 for instruction: %cttz -; AVX512F: Found an estimated cost of 28 for instruction: %cttz -; AVX512BW: Found an estimated cost of 14 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i32u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i32u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX1-LABEL: 'var_cttz_v16i32u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX2-LABEL: 'var_cttz_v16i32u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX512F-LABEL: 'var_cttz_v16i32u' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v16i32u' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %cttz +; %cttz = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> %a, i1 1) ret <16 x i32> %cttz } define <8 x i16> @var_cttz_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i16': -; SSE2: Found an estimated cost of 16 for instruction: %cttz -; SSE42: Found an estimated cost of 12 for instruction: %cttz -; AVX: Found an estimated cost of 12 for instruction: %cttz -; AVX512: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i16' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i16' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; AVX-LABEL: 'var_cttz_v8i16' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; AVX512-LABEL: 'var_cttz_v8i16' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 0) ret <8 x i16> %cttz } define <8 x i16> @var_cttz_v8i16u(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v8i16u': -; SSE2: Found an estimated cost of 16 for instruction: %cttz -; SSE42: Found an estimated cost of 12 for instruction: %cttz -; AVX: Found an estimated cost of 12 for instruction: %cttz -; AVX512: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v8i16u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v8i16u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; AVX-LABEL: 'var_cttz_v8i16u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; +; AVX512-LABEL: 'var_cttz_v8i16u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %cttz +; %cttz = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> %a, i1 1) ret <8 x i16> %cttz } define <16 x i16> @var_cttz_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i16': -; SSE2: Found an estimated cost of 32 for instruction: %cttz -; SSE42: Found an estimated cost of 24 for instruction: %cttz -; AVX1: Found an estimated cost of 26 for instruction: %cttz -; AVX2: Found an estimated cost of 12 for instruction: %cttz -; AVX512: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i16' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i16' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX1-LABEL: 'var_cttz_v16i16' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX2-LABEL: 'var_cttz_v16i16' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX512-LABEL: 'var_cttz_v16i16' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 0) ret <16 x i16> %cttz } define <16 x i16> @var_cttz_v16i16u(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i16u': -; SSE2: Found an estimated cost of 32 for instruction: %cttz -; SSE42: Found an estimated cost of 24 for instruction: %cttz -; AVX1: Found an estimated cost of 26 for instruction: %cttz -; AVX2: Found an estimated cost of 12 for instruction: %cttz -; AVX512: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i16u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i16u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX1-LABEL: 'var_cttz_v16i16u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX2-LABEL: 'var_cttz_v16i16u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; +; AVX512-LABEL: 'var_cttz_v16i16u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %cttz +; %cttz = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> %a, i1 1) ret <16 x i16> %cttz } define <32 x i16> @var_cttz_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i16': -; SSE2: Found an estimated cost of 64 for instruction: %cttz -; SSE42: Found an estimated cost of 48 for instruction: %cttz -; AVX1: Found an estimated cost of 52 for instruction: %cttz -; AVX2: Found an estimated cost of 24 for instruction: %cttz -; AVX512F: Found an estimated cost of 24 for instruction: %cttz -; AVX512BW: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v32i16' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v32i16' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX1-LABEL: 'var_cttz_v32i16' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX2-LABEL: 'var_cttz_v32i16' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX512F-LABEL: 'var_cttz_v32i16' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v32i16' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 0) ret <32 x i16> %cttz } define <32 x i16> @var_cttz_v32i16u(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i16u': -; SSE2: Found an estimated cost of 64 for instruction: %cttz -; SSE42: Found an estimated cost of 48 for instruction: %cttz -; AVX1: Found an estimated cost of 52 for instruction: %cttz -; AVX2: Found an estimated cost of 24 for instruction: %cttz -; AVX512F: Found an estimated cost of 24 for instruction: %cttz -; AVX512BW: Found an estimated cost of 12 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v32i16u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; SSE42-LABEL: 'var_cttz_v32i16u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX1-LABEL: 'var_cttz_v32i16u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX2-LABEL: 'var_cttz_v32i16u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX512F-LABEL: 'var_cttz_v32i16u' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v32i16u' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %cttz +; %cttz = call <32 x i16> @llvm.cttz.v32i16(<32 x i16> %a, i1 1) ret <32 x i16> %cttz } define <16 x i8> @var_cttz_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i8': -; SSE2: Found an estimated cost of 13 for instruction: %cttz -; SSE42: Found an estimated cost of 9 for instruction: %cttz -; AVX: Found an estimated cost of 9 for instruction: %cttz -; AVX512: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i8' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i8' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; AVX-LABEL: 'var_cttz_v16i8' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; AVX512-LABEL: 'var_cttz_v16i8' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 0) ret <16 x i8> %cttz } define <16 x i8> @var_cttz_v16i8u(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v16i8u': -; SSE2: Found an estimated cost of 13 for instruction: %cttz -; SSE42: Found an estimated cost of 9 for instruction: %cttz -; AVX: Found an estimated cost of 9 for instruction: %cttz -; AVX512: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v16i8u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v16i8u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; AVX-LABEL: 'var_cttz_v16i8u' +; 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) +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; +; AVX512-LABEL: 'var_cttz_v16i8u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %cttz +; %cttz = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> %a, i1 1) ret <16 x i8> %cttz } define <32 x i8> @var_cttz_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i8': -; SSE2: Found an estimated cost of 26 for instruction: %cttz -; SSE42: Found an estimated cost of 18 for instruction: %cttz -; AVX1: Found an estimated cost of 20 for instruction: %cttz -; AVX2: Found an estimated cost of 9 for instruction: %cttz -; AVX512: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v32i8' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v32i8' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX1-LABEL: 'var_cttz_v32i8' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX2-LABEL: 'var_cttz_v32i8' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX512-LABEL: 'var_cttz_v32i8' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 0) ret <32 x i8> %cttz } define <32 x i8> @var_cttz_v32i8u(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v32i8u': -; SSE2: Found an estimated cost of 26 for instruction: %cttz -; SSE42: Found an estimated cost of 18 for instruction: %cttz -; AVX1: Found an estimated cost of 20 for instruction: %cttz -; AVX2: Found an estimated cost of 9 for instruction: %cttz -; AVX512: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v32i8u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v32i8u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX1-LABEL: 'var_cttz_v32i8u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX2-LABEL: 'var_cttz_v32i8u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; +; AVX512-LABEL: 'var_cttz_v32i8u' +; 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) +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %cttz +; %cttz = call <32 x i8> @llvm.cttz.v32i8(<32 x i8> %a, i1 1) ret <32 x i8> %cttz } define <64 x i8> @var_cttz_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v64i8': -; SSE2: Found an estimated cost of 52 for instruction: %cttz -; SSE42: Found an estimated cost of 36 for instruction: %cttz -; AVX1: Found an estimated cost of 40 for instruction: %cttz -; AVX2: Found an estimated cost of 18 for instruction: %cttz -; AVX512F: Found an estimated cost of 18 for instruction: %cttz -; AVX512BW: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v64i8' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v64i8' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX1-LABEL: 'var_cttz_v64i8' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX2-LABEL: 'var_cttz_v64i8' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX512F-LABEL: 'var_cttz_v64i8' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v64i8' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 0) ret <64 x i8> %cttz } define <64 x i8> @var_cttz_v64i8u(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'var_cttz_v64i8u': -; SSE2: Found an estimated cost of 52 for instruction: %cttz -; SSE42: Found an estimated cost of 36 for instruction: %cttz -; AVX1: Found an estimated cost of 40 for instruction: %cttz -; AVX2: Found an estimated cost of 18 for instruction: %cttz -; AVX512F: Found an estimated cost of 18 for instruction: %cttz -; AVX512BW: Found an estimated cost of 9 for instruction: %cttz +; SSE2-LABEL: 'var_cttz_v64i8u' +; 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) +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; SSE42-LABEL: 'var_cttz_v64i8u' +; 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) +; SSE42-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX1-LABEL: 'var_cttz_v64i8u' +; 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) +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX2-LABEL: 'var_cttz_v64i8u' +; 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) +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX512F-LABEL: 'var_cttz_v64i8u' +; 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) +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; +; AVX512BW-LABEL: 'var_cttz_v64i8u' +; 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) +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %cttz +; %cttz = call <64 x i8> @llvm.cttz.v64i8(<64 x i8> %a, i1 1) ret <64 x i8> %cttz }