diff --git a/llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll b/llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll index eabc2330ddc6..8c94d315f355 100644 --- a/llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll +++ b/llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll @@ -1,15 +1,16 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.1 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE41 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK -check-prefix=XOP --check-prefix=XOPAVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK -check-prefix=XOP --check-prefix=XOPAVX2 -; 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=+avx512f,+avx512dq -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vl -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.1 | FileCheck %s --check-prefixes=CHECK,SSE,SSE41 +; 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=+xop,+avx | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX2 +; 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=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512VL +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BWVL ; Verify the cost of vector arithmetic shift right instructions. @@ -18,153 +19,398 @@ ; define <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v2i64': -; SSE2: Found an estimated cost of 12 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'var_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <2 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <2 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'var_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <2 x i64> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <2 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = ashr <2 x i64> %a, %b ret <2 x i64> %shift } define <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i64': -; SSE2: Found an estimated cost of 24 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE-LABEL: 'var_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <4 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = ashr <4 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <4 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOP-LABEL: 'var_shift_v4i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = ashr <4 x i64> %a, %b ret <4 x i64> %shift } define <8 x i64> @var_shift_v8i64(<8 x i64> %a, <8 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i64': -; SSE2: Found an estimated cost of 48 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 8 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE-LABEL: 'var_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <8 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = ashr <8 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <8 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOP-LABEL: 'var_shift_v8i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = ashr <8 x i64> %a, %b ret <8 x i64> %shift } define <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i32': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = ashr <4 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <4 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <4 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v4i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <4 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v4i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX-LABEL: 'var_shift_v4i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <4 x i32> %a, %b +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift %shift = ashr <4 x i32> %a, %b ret <4 x i32> %shift } define <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i32': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = ashr <8 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <8 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = ashr <8 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX-LABEL: 'var_shift_v8i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, %b +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift %shift = ashr <8 x i32> %a, %b ret <8 x i32> %shift } define <16 x i32> @var_shift_v16i32(<16 x i32> %a, <16 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i32': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = ashr <16 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <16 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = ashr <16 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX-LABEL: 'var_shift_v16i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, %b +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift %shift = ashr <16 x i32> %a, %b ret <16 x i32> %shift } define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i16': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 14 for instruction: %shift -; AVX: Found an estimated cost of 14 for instruction: %shift -; AVX2: Found an estimated cost of 14 for instruction: %shift -; AVX512F: Found an estimated cost of 14 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = ashr <8 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'var_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'var_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <8 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v8i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v8i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v8i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v8i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = ashr <8 x i16> %a, %b ret <8 x i16> %shift } define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i16': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 28 for instruction: %shift -; AVX: Found an estimated cost of 30 for instruction: %shift -; AVX2: Found an estimated cost of 10 for instruction: %shift -; AVX512F: Found an estimated cost of 10 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = ashr <16 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %shift = ashr <16 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOP-LABEL: 'var_shift_v16i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v16i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v16i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v16i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v16i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = ashr <16 x i16> %a, %b ret <16 x i16> %shift } define <32 x i16> @var_shift_v32i16(<32 x i16> %a, <32 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i16': -; SSE2: Found an estimated cost of 128 for instruction: %shift -; SSE41: Found an estimated cost of 56 for instruction: %shift -; AVX: Found an estimated cost of 60 for instruction: %shift -; AVX2: Found an estimated cost of 20 for instruction: %shift -; AVX512F: Found an estimated cost of 20 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %shift = ashr <32 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %shift = ashr <32 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOP-LABEL: 'var_shift_v32i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = ashr <32 x i16> %a, %b ret <32 x i16> %shift } define <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i8': -; SSE2: Found an estimated cost of 54 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %shift = ashr <16 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'var_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'var_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = ashr <16 x i8> %a, %b ret <16 x i8> %shift } define <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i8': -; SSE2: Found an estimated cost of 108 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 50 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512F: Found an estimated cost of 24 for instruction: %shift -; AVX512BW: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %shift = ashr <32 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <32 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %shift = ashr <32 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'var_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = ashr <32 x i8> %a, %b ret <32 x i8> %shift } define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v64i8': -; SSE2: Found an estimated cost of 216 for instruction: %shift -; SSE41: Found an estimated cost of 96 for instruction: %shift -; AVX: Found an estimated cost of 100 for instruction: %shift -; AVX2: Found an estimated cost of 48 for instruction: %shift -; AVX512F: Found an estimated cost of 48 for instruction: %shift -; AVX512BW: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'var_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 216 for instruction: %shift = ashr <64 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %shift = ashr <64 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'var_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'var_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'var_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'var_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = ashr <64 x i8> %a, %b ret <64 x i8> %shift } @@ -174,13 +420,30 @@ define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { ; define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX-LABEL: 'splatvar_shift_v2i64' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'splatvar_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <2 x i64> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <2 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %insert = insertelement <2 x i64> undef, i64 %b, i32 0 %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer %shift = ashr <2 x i64> %a, %splat @@ -188,13 +451,47 @@ define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { } define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <4 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <4 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <4 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v4i64' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift %insert = insertelement <4 x i64> undef, i64 %b, i32 0 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer %shift = ashr <4 x i64> %a, %splat @@ -202,13 +499,47 @@ define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { } define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 8 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = ashr <8 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <8 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <8 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v8i64' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift %insert = insertelement <8 x i64> undef, i64 %b, i32 0 %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer %shift = ashr <8 x i64> %a, %splat @@ -216,13 +547,12 @@ define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { } define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatvar_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i32> undef, i32 %b, i32 0 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, %splat +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %insert = insertelement <4 x i32> undef, i32 %b, i32 0 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer %shift = ashr <4 x i32> %a, %splat @@ -230,14 +560,47 @@ define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { } define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <8 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <8 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v8i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift %insert = insertelement <8 x i32> undef, i32 %b, i32 0 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer %shift = ashr <8 x i32> %a, %splat @@ -245,14 +608,47 @@ define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { } define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <16 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v16i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift %insert = insertelement <16 x i32> undef, i32 %b, i32 0 %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer %shift = ashr <16 x i32> %a, %splat @@ -260,13 +656,36 @@ define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { } define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'splatvar_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'splatvar_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %insert = insertelement <8 x i16> undef, i16 %b, i32 0 %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer %shift = ashr <8 x i16> %a, %splat @@ -274,14 +693,53 @@ define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { } define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v16i16' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift %insert = insertelement <16 x i16> undef, i16 %b, i32 0 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer %shift = ashr <16 x i16> %a, %splat @@ -289,15 +747,71 @@ define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { } define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v32i16' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift %insert = insertelement <32 x i16> undef, i16 %b, i32 0 %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer %shift = ashr <32 x i16> %a, %splat @@ -305,13 +819,36 @@ define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { } define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i8': -; SSE2: Found an estimated cost of 54 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %shift = ashr <16 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'splatvar_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'splatvar_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i8> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %insert = insertelement <16 x i8> undef, i8 %b, i32 0 %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer %shift = ashr <16 x i8> %a, %splat @@ -319,13 +856,53 @@ define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { } define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i8': -; SSE2: Found an estimated cost of 108 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 50 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %shift = ashr <32 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <32 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %shift = ashr <32 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v32i8' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift %insert = insertelement <32 x i8> undef, i8 %b, i32 0 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer %shift = ashr <32 x i8> %a, %splat @@ -333,14 +910,71 @@ define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { } define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v64i8': -; SSE2: Found an estimated cost of 216 for instruction: %shift -; SSE41: Found an estimated cost of 96 for instruction: %shift -; AVX: Found an estimated cost of 100 for instruction: %shift -; AVX2: Found an estimated cost of 48 for instruction: %shift -; AVX512F: Found an estimated cost of 48 for instruction: %shift -; AVX512BW: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 216 for instruction: %shift = ashr <64 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %shift = ashr <64 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX-LABEL: 'splatvar_shift_v64i8' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, %splat +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift %insert = insertelement <64 x i8> undef, i8 %b, i32 0 %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer %shift = ashr <64 x i8> %a, %splat @@ -352,152 +986,398 @@ define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { ; define <2 x i64> @constant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v2i64': -; SSE2: Found an estimated cost of 12 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'constant_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <2 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <2 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'constant_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <2 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <2 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = ashr <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @constant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i64': -; SSE2: Found an estimated cost of 24 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE-LABEL: 'constant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = ashr <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOP-LABEL: 'constant_shift_v4i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = ashr <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @constant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i64': -; SSE2: Found an estimated cost of 48 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 8 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE-LABEL: 'constant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = ashr <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOP-LABEL: 'constant_shift_v8i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = ashr <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @constant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i32': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = ashr <4 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <4 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <4 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v4i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <4 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v4i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX-LABEL: 'constant_shift_v4i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <4 x i32> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift %shift = ashr <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @constant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i32': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = ashr <8 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <8 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = ashr <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX-LABEL: 'constant_shift_v8i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift %shift = ashr <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @constant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i32': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = ashr <16 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <16 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = ashr <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX-LABEL: 'constant_shift_v16i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift %shift = ashr <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i16': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 14 for instruction: %shift -; AVX: Found an estimated cost of 14 for instruction: %shift -; AVX2: Found an estimated cost of 14 for instruction: %shift -; AVX512F: Found an estimated cost of 14 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = ashr <8 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'constant_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <8 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v8i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v8i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v8i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = ashr <8 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v8i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = ashr <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i16': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 28 for instruction: %shift -; AVX: Found an estimated cost of 30 for instruction: %shift -; AVX2: Found an estimated cost of 10 for instruction: %shift -; AVX512F: Found an estimated cost of 10 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = ashr <16 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %shift = ashr <16 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = ashr <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v16i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v16i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v16i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v16i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <16 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v16i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = ashr <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @constant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i16': -; SSE2: Found an estimated cost of 128 for instruction: %shift -; SSE41: Found an estimated cost of 56 for instruction: %shift -; AVX: Found an estimated cost of 60 for instruction: %shift -; AVX2: Found an estimated cost of 20 for instruction: %shift -; AVX512F: Found an estimated cost of 20 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %shift = ashr <32 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %shift = ashr <32 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = ashr <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v32i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = ashr <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @constant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i8': -; SSE2: Found an estimated cost of 54 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 54 for instruction: %shift = ashr <16 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'constant_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <16 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = ashr <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @constant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i8': -; SSE2: Found an estimated cost of 108 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 50 for instruction: %shift -; AVX2: Found an estimated cost of 24 for instruction: %shift -; AVX512: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 108 for instruction: %shift = ashr <32 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <32 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 50 for instruction: %shift = ashr <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = ashr <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v64i8': -; SSE2: Found an estimated cost of 216 for instruction: %shift -; SSE41: Found an estimated cost of 96 for instruction: %shift -; AVX: Found an estimated cost of 100 for instruction: %shift -; AVX2: Found an estimated cost of 48 for instruction: %shift -; AVX512F: Found an estimated cost of 48 for instruction: %shift -; AVX512BW: Found an estimated cost of 24 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 216 for instruction: %shift = ashr <64 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 96 for instruction: %shift = ashr <64 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 100 for instruction: %shift = ashr <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'constant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'constant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'constant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = ashr <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = ashr <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = ashr <64 x i8> %a, ret <64 x i8> %shift } @@ -507,155 +1387,341 @@ define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { ; define <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX-LABEL: 'splatconstant_shift_v2i64' +; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <2 x i64> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'splatconstant_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <2 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <2 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = ashr <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 4 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <4 x i64> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift %shift = ashr <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @splatconstant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 8 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 8 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = ashr <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <8 x i64> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift %shift = ashr <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <4 x i32> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = ashr <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <8 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <8 x i32> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift %shift = ashr <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @splatconstant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <16 x i32> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift %shift = ashr <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v8i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = ashr <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <16 x i16> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <16 x i16> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift %shift = ashr <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @splatconstant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = ashr <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <32 x i16> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift %shift = ashr <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i8': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 4 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'splatconstant_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i8> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'splatconstant_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = ashr <16 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <16 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = ashr <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i8': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512: Found an estimated cost of 4 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 4 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <32 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = ashr <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = ashr <32 x i8> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift %shift = ashr <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @splatconstant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v64i8': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 8 for instruction: %shift -; AVX512F: Found an estimated cost of 8 for instruction: %shift -; AVX512BW: Found an estimated cost of 4 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 8 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v64i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = ashr <64 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = ashr <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <64 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = ashr <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = ashr <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = ashr <64 x i8> %a, +; XOPAVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift %shift = ashr <64 x i8> %a, ret <64 x i8> %shift } diff --git a/llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll b/llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll index 6e890369d677..c60a8dcf741c 100644 --- a/llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll +++ b/llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll @@ -1,15 +1,16 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.1 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE41 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=XOP --check-prefix=XOPAVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=XOP --check-prefix=XOPAVX2 -; 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=+avx512f,+avx512dq -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vl -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.1 | FileCheck %s --check-prefixes=CHECK,SSE,SSE41 +; 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=+xop,+avx | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX2 +; 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=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512VL +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BWVL ; Verify the cost of vector logical shift right instructions. @@ -18,155 +19,401 @@ ; define <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'var_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOPAVX1-LABEL: 'var_shift_v2i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <2 x i64> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOPAVX2-LABEL: 'var_shift_v2i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = lshr <2 x i64> %a, %b ret <2 x i64> %shift } define <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'var_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <4 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'var_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <4 x i64> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'var_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = lshr <4 x i64> %a, %b ret <4 x i64> %shift } define <8 x i64> @var_shift_v8i64(<8 x i64> %a, <8 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'var_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = lshr <8 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'var_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <8 x i64> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'var_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = lshr <8 x i64> %a, %b ret <8 x i64> %shift } define <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i32': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 11 for instruction: %shift -; AVX: Found an estimated cost of 11 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = lshr <4 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v4i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v4i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = lshr <4 x i32> %a, %b ret <4 x i32> %shift } define <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i32': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 22 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = lshr <8 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <8 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <8 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <8 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = lshr <8 x i32> %a, %b ret <8 x i32> %shift } define <16 x i32> @var_shift_v16i32(<16 x i32> %a, <16 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i32': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 44 for instruction: %shift -; AVX: Found an estimated cost of 48 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = lshr <16 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %shift = lshr <16 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = lshr <16 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = lshr <16 x i32> %a, %b ret <16 x i32> %shift } define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i16': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 14 for instruction: %shift -; AVX: Found an estimated cost of 14 for instruction: %shift -; AVX2: Found an estimated cost of 14 for instruction: %shift -; AVX512F: Found an estimated cost of 14 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = lshr <8 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'var_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'var_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v8i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v8i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v8i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v8i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = lshr <8 x i16> %a, %b ret <8 x i16> %shift } define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i16': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 28 for instruction: %shift -; AVX: Found an estimated cost of 30 for instruction: %shift -; AVX2: Found an estimated cost of 10 for instruction: %shift -; AVX512F: Found an estimated cost of 10 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = lshr <16 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %shift = lshr <16 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOP-LABEL: 'var_shift_v16i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <16 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v16i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v16i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v16i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v16i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = lshr <16 x i16> %a, %b ret <16 x i16> %shift } define <32 x i16> @var_shift_v32i16(<32 x i16> %a, <32 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i16': -; SSE2: Found an estimated cost of 128 for instruction: %shift -; SSE41: Found an estimated cost of 56 for instruction: %shift -; AVX: Found an estimated cost of 60 for instruction: %shift -; AVX2: Found an estimated cost of 20 for instruction: %shift -; AVX512F: Found an estimated cost of 20 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %shift = lshr <32 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %shift = lshr <32 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOP-LABEL: 'var_shift_v32i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = lshr <32 x i16> %a, %b ret <32 x i16> %shift } define <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 12 for instruction: %shift -; AVX512: Found an estimated cost of 12 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <16 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'var_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'var_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = lshr <16 x i8> %a, %b ret <16 x i8> %shift } define <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <32 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <32 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <32 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'var_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = lshr <32 x i8> %a, %b ret <32 x i8> %shift } define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'var_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = lshr <64 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = lshr <64 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'var_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'var_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'var_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'var_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = lshr <64 x i8> %a, %b ret <64 x i8> %shift } @@ -176,13 +423,12 @@ define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { ; define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v2i64': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatvar_shift_v2i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, %splat +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %insert = insertelement <2 x i64> undef, i64 %b, i32 0 %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer %shift = lshr <2 x i64> %a, %splat @@ -190,14 +436,42 @@ define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { } define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i64': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <4 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %insert = insertelement <4 x i64> undef, i64 %b, i32 0 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer %shift = lshr <4 x i64> %a, %splat @@ -205,14 +479,42 @@ define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { } define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <8 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %insert = insertelement <8 x i64> undef, i64 %b, i32 0 %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer %shift = lshr <8 x i64> %a, %splat @@ -220,13 +522,12 @@ define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { } define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatvar_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i32> undef, i32 %b, i32 0 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, %splat +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %insert = insertelement <4 x i32> undef, i32 %b, i32 0 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer %shift = lshr <4 x i32> %a, %splat @@ -234,14 +535,42 @@ define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { } define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <8 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %insert = insertelement <8 x i32> undef, i32 %b, i32 0 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer %shift = lshr <8 x i32> %a, %splat @@ -249,14 +578,42 @@ define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { } define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <16 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %insert = insertelement <16 x i32> undef, i32 %b, i32 0 %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer %shift = lshr <16 x i32> %a, %splat @@ -264,13 +621,36 @@ define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { } define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'splatvar_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'splatvar_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %insert = insertelement <8 x i16> undef, i16 %b, i32 0 %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer %shift = lshr <8 x i16> %a, %splat @@ -278,14 +658,48 @@ define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { } define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <16 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %insert = insertelement <16 x i16> undef, i16 %b, i32 0 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer %shift = lshr <16 x i16> %a, %splat @@ -293,15 +707,66 @@ define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { } define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %insert = insertelement <32 x i16> undef, i16 %b, i32 0 %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer %shift = lshr <32 x i16> %a, %splat @@ -309,13 +774,36 @@ define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { } define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 12 for instruction: %shift -; AVX512: Found an estimated cost of 12 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <16 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'splatvar_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'splatvar_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %insert = insertelement <16 x i8> undef, i8 %b, i32 0 %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer %shift = lshr <16 x i8> %a, %splat @@ -323,13 +811,48 @@ define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { } define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <32 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <32 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <32 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %insert = insertelement <32 x i8> undef, i8 %b, i32 0 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer %shift = lshr <32 x i8> %a, %splat @@ -337,14 +860,66 @@ define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { } define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = lshr <64 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = lshr <64 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %insert = insertelement <64 x i8> undef, i8 %b, i32 0 %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer %shift = lshr <64 x i8> %a, %splat @@ -356,155 +931,401 @@ define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { ; define <2 x i64> @constant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'constant_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <2 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v2i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <2 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v2i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = lshr <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @constant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'constant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = lshr <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @constant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'constant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = lshr <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = lshr <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @constant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i32': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 11 for instruction: %shift -; AVX: Found an estimated cost of 11 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 2 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = lshr <4 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <4 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v4i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v4i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = lshr <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @constant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i32': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 22 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = lshr <8 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <8 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = lshr <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @constant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i32': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 44 for instruction: %shift -; AVX: Found an estimated cost of 48 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = lshr <16 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %shift = lshr <16 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = lshr <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = lshr <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i16': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 14 for instruction: %shift -; AVX: Found an estimated cost of 14 for instruction: %shift -; AVX2: Found an estimated cost of 14 for instruction: %shift -; AVX512F: Found an estimated cost of 14 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = lshr <8 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'constant_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v8i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v8i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v8i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = lshr <8 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v8i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = lshr <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i16': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 28 for instruction: %shift -; AVX: Found an estimated cost of 30 for instruction: %shift -; AVX2: Found an estimated cost of 10 for instruction: %shift -; AVX512F: Found an estimated cost of 10 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = lshr <16 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %shift = lshr <16 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = lshr <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v16i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <16 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v16i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v16i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v16i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = lshr <16 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v16i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = lshr <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @constant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i16': -; SSE2: Found an estimated cost of 128 for instruction: %shift -; SSE41: Found an estimated cost of 56 for instruction: %shift -; AVX: Found an estimated cost of 60 for instruction: %shift -; AVX2: Found an estimated cost of 20 for instruction: %shift -; AVX512F: Found an estimated cost of 20 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %shift = lshr <32 x i16> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'constant_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %shift = lshr <32 x i16> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = lshr <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOP-LABEL: 'constant_shift_v32i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i16> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = lshr <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = lshr <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @constant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 12 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 12 for instruction: %shift -; AVX512: Found an estimated cost of 12 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <16 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'constant_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = lshr <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @constant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 24 for instruction: %shift -; AVX: Found an estimated cost of 26 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 6 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <32 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = lshr <32 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = lshr <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = lshr <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 48 for instruction: %shift -; AVX: Found an estimated cost of 52 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 12 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = lshr <64 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = lshr <64 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = lshr <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'constant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'constant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'constant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = lshr <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = lshr <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = lshr <64 x i8> %a, ret <64 x i8> %shift } @@ -514,155 +1335,293 @@ define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { ; define <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v2i64': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v2i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <2 x i64> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = lshr <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i64': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = lshr <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @splatconstant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = lshr <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <4 x i32> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = lshr <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <8 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = lshr <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @splatconstant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = lshr <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v8i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = lshr <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <16 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <16 x i16> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = lshr <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @splatconstant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <32 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = lshr <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = lshr <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i8': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 2 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 2 for instruction: %shift -; XOP: Found an estimated cost of 2 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v16i8' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <16 x i8> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = lshr <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i8': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 6 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 2 for instruction: %shift -; XOPAVX: Found an estimated cost of 6 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <32 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = lshr <32 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = lshr <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @splatconstant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v64i8': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512F: Found an estimated cost of 4 for instruction: %shift -; AVX512BW: Found an estimated cost of 2 for instruction: %shift -; XOPAVX: Found an estimated cost of 12 for instruction: %shift -; XOPAVX2: Found an estimated cost of 4 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v64i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = lshr <64 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = lshr <64 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = lshr <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = lshr <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = lshr <64 x i8> %a, ret <64 x i8> %shift } diff --git a/llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll b/llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll index dd123c4d1320..51575f91be9d 100644 --- a/llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll +++ b/llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll @@ -1,173 +1,411 @@ -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.1 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=SSE41 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2 -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=XOP --check-prefix=XOPAVX -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+xop,+avx2 -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=XOP --check-prefix=XOPAVX2 -; 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=+avx512f,+avx512dq -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl -cost-model -analyze | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F -; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw,+avx512vl -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.1 | FileCheck %s --check-prefixes=CHECK,SSE,SSE41 +; 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=+xop,+avx | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX1 +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+xop,+avx2 | FileCheck %s --check-prefixes=CHECK,XOP,XOPAVX2 +; 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=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512VL +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -cost-model -analyze -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BWVL ; Verify the cost of vector shift left instructions. -; ; ; Variable Shifts ; define <2 x i64> @var_shift_v2i64(<2 x i64> %a, <2 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'var_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <2 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <2 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'var_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = shl <2 x i64> %a, %b ret <2 x i64> %shift } define <4 x i64> @var_shift_v4i64(<4 x i64> %a, <4 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'var_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <4 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <4 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'var_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'var_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = shl <4 x i64> %a, %b ret <4 x i64> %shift } define <8 x i64> @var_shift_v8i64(<8 x i64> %a, <8 x i64> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'var_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = shl <8 x i64> %a, %b +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'var_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <8 x i64> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'var_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'var_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'var_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'var_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i64> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = shl <8 x i64> %a, %b ret <8 x i64> %shift } define <4 x i32> @var_shift_v4i32(<4 x i32> %a, <4 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v4i32': -; SSE2: Found an estimated cost of 10 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <4 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOP-LABEL: 'var_shift_v4i32' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = shl <4 x i32> %a, %b ret <4 x i32> %shift } define <8 x i32> @var_shift_v8i32(<8 x i32> %a, <8 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i32': -; SSE2: Found an estimated cost of 20 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <8 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <8 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = shl <8 x i32> %a, %b ret <8 x i32> %shift } define <16 x i32> @var_shift_v16i32(<16 x i32> %a, <16 x i32> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i32': -; SSE2: Found an estimated cost of 40 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 40 for instruction: %shift = shl <16 x i32> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'var_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = shl <16 x i32> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'var_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <16 x i32> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'var_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'var_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, %b +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'var_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, %b +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'var_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i32> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = shl <16 x i32> %a, %b ret <16 x i32> %shift } define <8 x i16> @var_shift_v8i16(<8 x i16> %a, <8 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v8i16': -; SSE2: Found an estimated cost of 32 for instruction: %shift -; SSE41: Found an estimated cost of 14 for instruction: %shift -; AVX: Found an estimated cost of 14 for instruction: %shift -; AVX2: Found an estimated cost of 14 for instruction: %shift -; AVX512F: Found an estimated cost of 14 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %shift = shl <8 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = shl <8 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'var_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = shl <8 x i16> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'var_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v8i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = shl <8 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v8i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v8i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %shift = shl <8 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v8i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = shl <8 x i16> %a, %b ret <8 x i16> %shift } define <16 x i16> @var_shift_v16i16(<16 x i16> %a, <16 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i16': -; SSE2: Found an estimated cost of 64 for instruction: %shift -; SSE41: Found an estimated cost of 28 for instruction: %shift -; AVX: Found an estimated cost of 30 for instruction: %shift -; AVX2: Found an estimated cost of 10 for instruction: %shift -; AVX512F: Found an estimated cost of 10 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 4 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %shift = shl <16 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %shift = shl <16 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 30 for instruction: %shift = shl <16 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <16 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOP-LABEL: 'var_shift_v16i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v16i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <16 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v16i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v16i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <16 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v16i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = shl <16 x i16> %a, %b ret <16 x i16> %shift } define <32 x i16> @var_shift_v32i16(<32 x i16> %a, <32 x i16> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i16': -; SSE2: Found an estimated cost of 128 for instruction: %shift -; SSE41: Found an estimated cost of 56 for instruction: %shift -; AVX: Found an estimated cost of 60 for instruction: %shift -; AVX2: Found an estimated cost of 20 for instruction: %shift -; AVX512F: Found an estimated cost of 20 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 8 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 128 for instruction: %shift = shl <32 x i16> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'var_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 56 for instruction: %shift = shl <32 x i16> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'var_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 60 for instruction: %shift = shl <32 x i16> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'var_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <32 x i16> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOP-LABEL: 'var_shift_v32i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'var_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <32 x i16> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'var_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'var_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <32 x i16> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = shl <32 x i16> %a, %b ret <32 x i16> %shift } define <16 x i8> @var_shift_v16i8(<16 x i8> %a, <16 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 11 for instruction: %shift -; AVX: Found an estimated cost of 11 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'var_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = shl <16 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'var_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %b +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'var_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = shl <16 x i8> %a, %b ret <16 x i8> %shift } define <32 x i8> @var_shift_v32i8(<32 x i8> %a, <32 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 22 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 4 for instruction: %shift +; SSE2-LABEL: 'var_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = shl <32 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <32 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = shl <32 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'var_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'var_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, %b +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = shl <32 x i8> %a, %b ret <32 x i8> %shift } define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { -; CHECK: 'Cost Model Analysis' for function 'var_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 44 for instruction: %shift -; AVX: Found an estimated cost of 48 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 8 for instruction: %shift +; SSE2-LABEL: 'var_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = shl <64 x i8> %a, %b +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'var_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %shift = shl <64 x i8> %a, %b +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'var_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = shl <64 x i8> %a, %b +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'var_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %b +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'var_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, %b +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'var_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %b +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'var_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, %b +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'var_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %b +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'var_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, %b +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = shl <64 x i8> %a, %b ret <64 x i8> %shift } @@ -177,13 +415,12 @@ define <64 x i8> @var_shift_v64i8(<64 x i8> %a, <64 x i8> %b) { ; define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v2i64': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatvar_shift_v2i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <2 x i64> undef, i64 %b, i32 0 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, %splat +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %insert = insertelement <2 x i64> undef, i64 %b, i32 0 %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer %shift = shl <2 x i64> %a, %splat @@ -191,14 +428,42 @@ define <2 x i64> @splatvar_shift_v2i64(<2 x i64> %a, i64 %b) { } define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i64': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <4 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %insert = insertelement <4 x i64> undef, i64 %b, i32 0 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer %shift = shl <4 x i64> %a, %splat @@ -206,14 +471,42 @@ define <4 x i64> @splatvar_shift_v4i64(<4 x i64> %a, i64 %b) { } define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i64> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i64> undef, i64 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i64> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %insert = insertelement <8 x i64> undef, i64 %b, i32 0 %splat = shufflevector <8 x i64> %insert, <8 x i64> undef, <8 x i32> zeroinitializer %shift = shl <8 x i64> %a, %splat @@ -221,13 +514,12 @@ define <8 x i64> @splatvar_shift_v8i64(<8 x i64> %a, i64 %b) { } define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatvar_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <4 x i32> undef, i32 %b, i32 0 +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, %splat +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %insert = insertelement <4 x i32> undef, i32 %b, i32 0 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer %shift = shl <4 x i32> %a, %splat @@ -235,14 +527,42 @@ define <4 x i32> @splatvar_shift_v4i32(<4 x i32> %a, i32 %b) { } define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %insert = insertelement <8 x i32> undef, i32 %b, i32 0 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer %shift = shl <8 x i32> %a, %splat @@ -250,14 +570,42 @@ define <8 x i32> @splatvar_shift_v8i32(<8 x i32> %a, i32 %b) { } define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatvar_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i32> %a, %splat +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i32> undef, i32 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i32> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %insert = insertelement <16 x i32> undef, i32 %b, i32 0 %splat = shufflevector <16 x i32> %insert, <16 x i32> undef, <16 x i32> zeroinitializer %shift = shl <16 x i32> %a, %splat @@ -265,13 +613,36 @@ define <16 x i32> @splatvar_shift_v16i32(<16 x i32> %a, i32 %b) { } define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v8i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v8i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX-LABEL: 'splatvar_shift_v8i16' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; XOP-LABEL: 'splatvar_shift_v8i16' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v8i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <8 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %insert = insertelement <8 x i16> undef, i16 %b, i32 0 %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer %shift = shl <8 x i16> %a, %splat @@ -279,14 +650,48 @@ define <8 x i16> @splatvar_shift_v8i16(<8 x i16> %a, i16 %b) { } define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i16> undef, i16 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %insert = insertelement <16 x i16> undef, i16 %b, i32 0 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer %shift = shl <16 x i16> %a, %splat @@ -294,15 +699,66 @@ define <16 x i16> @splatvar_shift_v16i16(<16 x i16> %a, i16 %b) { } define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i16' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i16> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i16' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i16> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i16> undef, i16 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %insert = insertelement <32 x i16> undef, i16 %b, i32 0 %splat = shufflevector <32 x i16> %insert, <32 x i16> undef, <32 x i32> zeroinitializer %shift = shl <32 x i16> %a, %splat @@ -310,13 +766,36 @@ define <32 x i16> @splatvar_shift_v32i16(<32 x i16> %a, i16 %b) { } define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 11 for instruction: %shift -; AVX: Found an estimated cost of 11 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = shl <16 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'splatvar_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %splat +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'splatvar_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i8> %a, %splat +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <16 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %insert = insertelement <16 x i8> undef, i8 %b, i32 0 %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer %shift = shl <16 x i8> %a, %splat @@ -324,13 +803,48 @@ define <16 x i8> @splatvar_shift_v16i8(<16 x i8> %a, i8 %b) { } define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 22 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 4 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = shl <32 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <32 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = shl <32 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatvar_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <32 x i8> undef, i8 %b, i32 0 +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, %splat +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %insert = insertelement <32 x i8> undef, i8 %b, i32 0 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer %shift = shl <32 x i8> %a, %splat @@ -338,14 +852,66 @@ define <32 x i8> @splatvar_shift_v32i8(<32 x i8> %a, i8 %b) { } define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { -; CHECK: 'Cost Model Analysis' for function 'splatvar_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 44 for instruction: %shift -; AVX: Found an estimated cost of 48 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 8 for instruction: %shift +; SSE2-LABEL: 'splatvar_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE2-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = shl <64 x i8> %a, %splat +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'splatvar_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; SSE41-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; SSE41-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %shift = shl <64 x i8> %a, %splat +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatvar_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatvar_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatvar_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, %splat +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatvar_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, %splat +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatvar_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512F-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatvar_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatvar_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatvar_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %insert = insertelement <64 x i8> undef, i8 %b, i32 0 +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, %splat +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %insert = insertelement <64 x i8> undef, i8 %b, i32 0 %splat = shufflevector <64 x i8> %insert, <64 x i8> undef, <64 x i32> zeroinitializer %shift = shl <64 x i8> %a, %splat @@ -357,155 +923,353 @@ define <64 x i8> @splatvar_shift_v64i8(<64 x i8> %a, i8 %b) { ; define <2 x i64> @constant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v2i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'constant_shift_v2i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <2 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v2i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <2 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v2i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; XOP-LABEL: 'constant_shift_v2i64' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v2i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = shl <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @constant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i64': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 10 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'constant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shift = shl <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = shl <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @constant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i64': -; SSE2: Found an estimated cost of 16 for instruction: %shift -; SSE41: Found an estimated cost of 16 for instruction: %shift -; AVX: Found an estimated cost of 20 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'constant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shift = shl <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'constant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shift = shl <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'constant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'constant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = shl <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @constant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v4i32': -; SSE2: Found an estimated cost of 6 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 2 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v4i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = shl <4 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v4i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <4 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v4i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <4 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v4i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; XOP-LABEL: 'constant_shift_v4i32' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v4i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = shl <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @constant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i32': -; SSE2: Found an estimated cost of 12 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v8i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = shl <8 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v8i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = shl <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @constant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i32': -; SSE2: Found an estimated cost of 24 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i32' +; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = shl <16 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; SSE41-LABEL: 'constant_shift_v16i32' +; SSE41-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'constant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'constant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'constant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = shl <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @constant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'constant_shift_v8i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = shl <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @constant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'constant_shift_v16i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'constant_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = shl <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @constant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'constant_shift_v32i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'constant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'constant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'constant_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'constant_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'constant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'constant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'constant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = shl <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @constant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v16i8': -; SSE2: Found an estimated cost of 26 for instruction: %shift -; SSE41: Found an estimated cost of 11 for instruction: %shift -; AVX: Found an estimated cost of 11 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v16i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 26 for instruction: %shift = shl <16 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v16i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'constant_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <16 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = shl <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @constant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v32i8': -; SSE2: Found an estimated cost of 52 for instruction: %shift -; SSE41: Found an estimated cost of 22 for instruction: %shift -; AVX: Found an estimated cost of 24 for instruction: %shift -; AVX2: Found an estimated cost of 11 for instruction: %shift -; AVX512: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 4 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v32i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 52 for instruction: %shift = shl <32 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v32i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <32 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shift = shl <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v32i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'constant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = shl <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'constant_shift_v64i8': -; SSE2: Found an estimated cost of 104 for instruction: %shift -; SSE41: Found an estimated cost of 44 for instruction: %shift -; AVX: Found an estimated cost of 48 for instruction: %shift -; AVX2: Found an estimated cost of 22 for instruction: %shift -; AVX512F: Found an estimated cost of 22 for instruction: %shift -; AVX512BW: Found an estimated cost of 11 for instruction: %shift -; XOP: Found an estimated cost of 8 for instruction: %shift +; SSE2-LABEL: 'constant_shift_v64i8' +; SSE2-NEXT: Cost Model: Found an estimated cost of 104 for instruction: %shift = shl <64 x i8> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; SSE41-LABEL: 'constant_shift_v64i8' +; SSE41-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %shift = shl <64 x i8> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'constant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %shift = shl <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'constant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOP-LABEL: 'constant_shift_v64i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'constant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'constant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'constant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %shift = shl <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'constant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %shift = shl <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = shl <64 x i8> %a, ret <64 x i8> %shift } @@ -515,157 +1279,305 @@ define <64 x i8> @constant_shift_v64i8(<64 x i8> %a) { ; define <2 x i64> @splatconstant_shift_v2i64(<2 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v2i64': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v2i64' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <2 x i64> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shift +; %shift = shl <2 x i64> %a, ret <2 x i64> %shift } define <4 x i64> @splatconstant_shift_v4i64(<4 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i64': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v4i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v4i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v4i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v4i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v4i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shift +; %shift = shl <4 x i64> %a, ret <4 x i64> %shift } define <8 x i64> @splatconstant_shift_v8i64(<8 x i64> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i64': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i64' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i64' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i64' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i64' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i64' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shift +; %shift = shl <8 x i64> %a, ret <8 x i64> %shift } define <4 x i32> @splatconstant_shift_v4i32(<4 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v4i32': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 1 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v4i32' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <4 x i32> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shift +; %shift = shl <4 x i32> %a, ret <4 x i32> %shift } define <8 x i32> @splatconstant_shift_v8i32(<8 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i32': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v8i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <8 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v8i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v8i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v8i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v8i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shift +; %shift = shl <8 x i32> %a, ret <8 x i32> %shift } define <16 x i32> @splatconstant_shift_v16i32(<16 x i32> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i32': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i32' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i32> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i32' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i32' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i32' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i32' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shift +; %shift = shl <16 x i32> %a, ret <16 x i32> %shift } define <8 x i16> @splatconstant_shift_v8i16(<8 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v8i16': -; SSE2: Found an estimated cost of 1 for instruction: %shift -; SSE41: Found an estimated cost of 1 for instruction: %shift -; AVX: Found an estimated cost of 1 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; CHECK-LABEL: 'splatconstant_shift_v8i16' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shift +; %shift = shl <8 x i16> %a, ret <8 x i16> %shift } define <16 x i16> @splatconstant_shift_v16i16(<16 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i16': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 4 for instruction: %shift -; AVX2: Found an estimated cost of 1 for instruction: %shift -; AVX512: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v16i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v16i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <16 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v16i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i16' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i16> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shift +; %shift = shl <16 x i16> %a, ret <16 x i16> %shift } define <32 x i16> @splatconstant_shift_v32i16(<32 x i16> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i16': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 8 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512F: Found an estimated cost of 2 for instruction: %shift -; AVX512BW: Found an estimated cost of 1 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i16' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i16' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i16' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <32 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i16' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v32i16' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v32i16' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v32i16' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v32i16' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shift +; %shift = shl <32 x i16> %a, ret <32 x i16> %shift } define <16 x i8> @splatconstant_shift_v16i8(<16 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v16i8': -; SSE2: Found an estimated cost of 2 for instruction: %shift -; SSE41: Found an estimated cost of 2 for instruction: %shift -; AVX: Found an estimated cost of 2 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 2 for instruction: %shift -; XOP: Found an estimated cost of 1 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v16i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX-LABEL: 'splatconstant_shift_v16i8' +; AVX-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i8> %a, +; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; XOP-LABEL: 'splatconstant_shift_v16i8' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shift = shl <16 x i8> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v16i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <16 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %shift +; %shift = shl <16 x i8> %a, ret <16 x i8> %shift } define <32 x i8> @splatconstant_shift_v32i8(<32 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v32i8': -; SSE2: Found an estimated cost of 4 for instruction: %shift -; SSE41: Found an estimated cost of 4 for instruction: %shift -; AVX: Found an estimated cost of 6 for instruction: %shift -; AVX2: Found an estimated cost of 2 for instruction: %shift -; AVX512: Found an estimated cost of 2 for instruction: %shift -; XOPAVX: Found an estimated cost of 4 for instruction: %shift -; XOPAVX2: Found an estimated cost of 2 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v32i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v32i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shift = shl <32 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v32i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <32 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v32i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; +; AVX512-LABEL: 'splatconstant_shift_v32i8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <32 x i8> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %shift +; %shift = shl <32 x i8> %a, ret <32 x i8> %shift } define <64 x i8> @splatconstant_shift_v64i8(<64 x i8> %a) { -; CHECK: 'Cost Model Analysis' for function 'splatconstant_shift_v64i8': -; SSE2: Found an estimated cost of 8 for instruction: %shift -; SSE41: Found an estimated cost of 8 for instruction: %shift -; AVX: Found an estimated cost of 12 for instruction: %shift -; AVX2: Found an estimated cost of 4 for instruction: %shift -; AVX512F: Found an estimated cost of 4 for instruction: %shift -; AVX512BW: Found an estimated cost of 2 for instruction: %shift -; XOPAVX: Found an estimated cost of 8 for instruction: %shift -; XOPAVX2: Found an estimated cost of 4 for instruction: %shift +; SSE-LABEL: 'splatconstant_shift_v64i8' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX1-LABEL: 'splatconstant_shift_v64i8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shift = shl <64 x i8> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX2-LABEL: 'splatconstant_shift_v64i8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <64 x i8> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX1-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shift = shl <64 x i8> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; XOPAVX2-LABEL: 'splatconstant_shift_v64i8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <64 x i8> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512F-LABEL: 'splatconstant_shift_v64i8' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <64 x i8> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BW-LABEL: 'splatconstant_shift_v64i8' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <64 x i8> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512VL-LABEL: 'splatconstant_shift_v64i8' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shift = shl <64 x i8> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; +; AVX512BWVL-LABEL: 'splatconstant_shift_v64i8' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shift = shl <64 x i8> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <64 x i8> %shift +; %shift = shl <64 x i8> %a, ret <64 x i8> %shift } @@ -678,20 +1590,22 @@ define <64 x i8> @splatconstant_shift_v64i8(<64 x i8> %a) { ; non-uniform constant. define <8 x i16> @test1(<8 x i16> %a) { +; CHECK-LABEL: 'test1' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shl +; %shl = shl <8 x i16> %a, ret <8 x i16> %shl } -; CHECK: 'Cost Model Analysis' for function 'test1': -; CHECK: Found an estimated cost of 1 for instruction: %shl - define <8 x i16> @test2(<8 x i16> %a) { +; CHECK-LABEL: 'test2' +; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i16> %a, +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %shl +; %shl = shl <8 x i16> %a, ret <8 x i16> %shl } -; CHECK: 'Cost Model Analysis' for function 'test2': -; CHECK: Found an estimated cost of 1 for instruction: %shl - ; With SSE4.1, v4i32 shifts can be lowered into a single pmulld instruction. ; Make sure that the estimated cost is always 2 except for the case where @@ -699,28 +1613,62 @@ define <8 x i16> @test2(<8 x i16> %a) { ; v4i32 mul as a 2x shuffle, 2x pmuludq, 2x shuffle. define <4 x i32> @test3(<4 x i32> %a) { +; SSE2-LABEL: 'test3' +; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shl = shl <4 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; SSE41-LABEL: 'test3' +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <4 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX1-LABEL: 'test3' +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <4 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX2-LABEL: 'test3' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; XOP-LABEL: 'test3' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX512-LABEL: 'test3' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; %shl = shl <4 x i32> %a, ret <4 x i32> %shl } -; CHECK: 'Cost Model Analysis' for function 'test3': -; SSE2: Found an estimated cost of 6 for instruction: %shl -; SSE41: Found an estimated cost of 2 for instruction: %shl -; AVX: Found an estimated cost of 2 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOP: Found an estimated cost of 1 for instruction: %shl - define <4 x i32> @test4(<4 x i32> %a) { +; SSE2-LABEL: 'test4' +; SSE2-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %shl = shl <4 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; SSE41-LABEL: 'test4' +; SSE41-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <4 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX1-LABEL: 'test4' +; AVX1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <4 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX2-LABEL: 'test4' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; XOP-LABEL: 'test4' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; +; AVX512-LABEL: 'test4' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %shl +; %shl = shl <4 x i32> %a, ret <4 x i32> %shl } -; CHECK: 'Cost Model Analysis' for function 'test4': -; SSE2: Found an estimated cost of 6 for instruction: %shl -; SSE41: Found an estimated cost of 2 for instruction: %shl -; AVX: Found an estimated cost of 2 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOP: Found an estimated cost of 1 for instruction: %shl - ; On AVX2 we are able to lower the following shift into a single ; vpsllvq. Therefore, the expected cost is only 1. @@ -728,16 +1676,29 @@ define <4 x i32> @test4(<4 x i32> %a) { ; vpsllv instructions. define <2 x i64> @test5(<2 x i64> %a) { +; SSE-LABEL: 'test5' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <2 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shl +; +; AVX1-LABEL: 'test5' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <2 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shl +; +; AVX2-LABEL: 'test5' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <2 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shl +; +; XOP-LABEL: 'test5' +; XOP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <2 x i64> %a, +; XOP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shl +; +; AVX512-LABEL: 'test5' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <2 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %shl +; %shl = shl <2 x i64> %a, ret <2 x i64> %shl } -; CHECK: 'Cost Model Analysis' for function 'test5': -; SSE2: Found an estimated cost of 4 for instruction: %shl -; SSE41: Found an estimated cost of 4 for instruction: %shl -; AVX: Found an estimated cost of 4 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOP: Found an estimated cost of 1 for instruction: %shl - ; v16i16 and v8i32 shift left by non-uniform constant are lowered into ; vector multiply instructions. With AVX (but not AVX2), the vector multiply @@ -751,36 +1712,71 @@ define <2 x i64> @test5(<2 x i64> %a) { ; the cost computed in the case of 'test1'. That is because the backend ; simply emits 2 pmullw with no extract/insert. - define <16 x i16> @test6(<16 x i16> %a) { +; SSE-LABEL: 'test6' +; SSE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <16 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; +; AVX1-LABEL: 'test6' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <16 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; +; AVX2-LABEL: 'test6' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <16 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; +; XOPAVX1-LABEL: 'test6' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <16 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; +; XOPAVX2-LABEL: 'test6' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <16 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; +; AVX512-LABEL: 'test6' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <16 x i16> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %shl +; %shl = shl <16 x i16> %a, ret <16 x i16> %shl } -; CHECK: 'Cost Model Analysis' for function 'test6': -; SSE2: Found an estimated cost of 2 for instruction: %shl -; SSE41: Found an estimated cost of 2 for instruction: %shl -; AVX: Found an estimated cost of 4 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOPAVX: Found an estimated cost of 4 for instruction: %shl -; XOPAVX2: Found an estimated cost of 1 for instruction: %shl - ; With SSE2 and SSE4.1, the vector shift cost for 'test7' is twice ; the cost computed in the case of 'test3'. That is because the multiply ; is type-legalized into two 4i32 vector multiply. define <8 x i32> @test7(<8 x i32> %a) { +; SSE2-LABEL: 'test7' +; SSE2-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %shl = shl <8 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; SSE41-LABEL: 'test7' +; SSE41-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <8 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; AVX1-LABEL: 'test7' +; AVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <8 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; AVX2-LABEL: 'test7' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; XOPAVX1-LABEL: 'test7' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <8 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; XOPAVX2-LABEL: 'test7' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; +; AVX512-LABEL: 'test7' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %shl +; %shl = shl <8 x i32> %a, ret <8 x i32> %shl } -; CHECK: 'Cost Model Analysis' for function 'test7': -; SSE2: Found an estimated cost of 12 for instruction: %shl -; SSE41: Found an estimated cost of 4 for instruction: %shl -; AVX: Found an estimated cost of 4 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOPAVX: Found an estimated cost of 4 for instruction: %shl -; XOPAVX2: Found an estimated cost of 1 for instruction: %shl - ; On AVX2 we are able to lower the following shift into a single ; vpsllvq. Therefore, the expected cost is only 1. @@ -788,47 +1784,111 @@ define <8 x i32> @test7(<8 x i32> %a) { ; vpsllv instructions. define <4 x i64> @test8(<4 x i64> %a) { +; SSE-LABEL: 'test8' +; SSE-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <4 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; +; AVX1-LABEL: 'test8' +; AVX1-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %shl = shl <4 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; +; AVX2-LABEL: 'test8' +; AVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; +; XOPAVX1-LABEL: 'test8' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <4 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; +; XOPAVX2-LABEL: 'test8' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; +; AVX512-LABEL: 'test8' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <4 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %shl +; %shl = shl <4 x i64> %a, ret <4 x i64> %shl } -; CHECK: 'Cost Model Analysis' for function 'test8': -; SSE2: Found an estimated cost of 8 for instruction: %shl -; SSE41: Found an estimated cost of 8 for instruction: %shl -; AVX: Found an estimated cost of 10 for instruction: %shl -; AVX2: Found an estimated cost of 1 for instruction: %shl -; XOPAVX: Found an estimated cost of 4 for instruction: %shl -; XOPAVX2: Found an estimated cost of 1 for instruction: %shl - ; Same as 'test6', with the difference that the cost is double. define <32 x i16> @test9(<32 x i16> %a) { +; SSE-LABEL: 'test9' +; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %shl = shl <32 x i16> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX1-LABEL: 'test9' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <32 x i16> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX2-LABEL: 'test9' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <32 x i16> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; XOPAVX1-LABEL: 'test9' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <32 x i16> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; XOPAVX2-LABEL: 'test9' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <32 x i16> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX512F-LABEL: 'test9' +; AVX512F-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <32 x i16> %a, +; AVX512F-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX512BW-LABEL: 'test9' +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <32 x i16> %a, +; AVX512BW-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX512VL-LABEL: 'test9' +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <32 x i16> %a, +; AVX512VL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; +; AVX512BWVL-LABEL: 'test9' +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <32 x i16> %a, +; AVX512BWVL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i16> %shl +; %shl = shl <32 x i16> %a, ret <32 x i16> %shl } -; CHECK: 'Cost Model Analysis' for function 'test9': -; SSE2: Found an estimated cost of 4 for instruction: %shl -; SSE41: Found an estimated cost of 4 for instruction: %shl -; AVX: Found an estimated cost of 8 for instruction: %shl -; AVX2: Found an estimated cost of 2 for instruction: %shl -; XOPAVX: Found an estimated cost of 8 for instruction: %shl -; XOPAVX2: Found an estimated cost of 2 for instruction: %shl - ; Same as 'test7', except that now the cost is double. define <16 x i32> @test10(<16 x i32> %a) { +; SSE2-LABEL: 'test10' +; SSE2-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %shl = shl <16 x i32> %a, +; SSE2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; SSE41-LABEL: 'test10' +; SSE41-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <16 x i32> %a, +; SSE41-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; AVX1-LABEL: 'test10' +; AVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <16 x i32> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; AVX2-LABEL: 'test10' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <16 x i32> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; XOPAVX1-LABEL: 'test10' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <16 x i32> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; XOPAVX2-LABEL: 'test10' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <16 x i32> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; +; AVX512-LABEL: 'test10' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <16 x i32> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %shl +; %shl = shl <16 x i32> %a, ret <16 x i32> %shl } -; CHECK: 'Cost Model Analysis' for function 'test10': -; SSE2: Found an estimated cost of 24 for instruction: %shl -; SSE41: Found an estimated cost of 8 for instruction: %shl -; AVX: Found an estimated cost of 8 for instruction: %shl -; AVX2: Found an estimated cost of 2 for instruction: %shl -; XOPAVX: Found an estimated cost of 8 for instruction: %shl -; XOPAVX2: Found an estimated cost of 2 for instruction: %shl - ; On AVX2 we are able to lower the following shift into a sequence of ; two vpsllvq instructions. Therefore, the expected cost is only 2. @@ -836,13 +1896,30 @@ define <16 x i32> @test10(<16 x i32> %a) { ; instructions. define <8 x i64> @test11(<8 x i64> %a) { +; SSE-LABEL: 'test11' +; SSE-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %shl = shl <8 x i64> %a, +; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; +; AVX1-LABEL: 'test11' +; AVX1-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %shl = shl <8 x i64> %a, +; AVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; +; AVX2-LABEL: 'test11' +; AVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <8 x i64> %a, +; AVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; +; XOPAVX1-LABEL: 'test11' +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %shl = shl <8 x i64> %a, +; XOPAVX1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; +; XOPAVX2-LABEL: 'test11' +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %shl = shl <8 x i64> %a, +; XOPAVX2-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; +; AVX512-LABEL: 'test11' +; AVX512-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %shl = shl <8 x i64> %a, +; AVX512-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %shl +; %shl = shl <8 x i64> %a, ret <8 x i64> %shl } -; CHECK: 'Cost Model Analysis' for function 'test11': -; SSE2: Found an estimated cost of 16 for instruction: %shl -; SSE41: Found an estimated cost of 16 for instruction: %shl -; AVX: Found an estimated cost of 20 for instruction: %shl -; AVX2: Found an estimated cost of 2 for instruction: %shl -; XOPAVX: Found an estimated cost of 8 for instruction: %shl -; XOPAVX2: Found an estimated cost of 2 for instruction: %shl