<commit_before>; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+ssse3 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSSE3
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW

;
; Verify the cost model for 1 src shuffles
;

; AVX512-LABEL: 'test_vXf64'
define void @test_vXf64(<4 x double> %src256, <8 x double> %src512, <16 x double> %src1024) {
  ; SSE2: cost of 4 {{.*}} %V256 = shufflevector
  ; SSSE3: cost of 4 {{.*}} %V256 = shufflevector
  ; SSE42: cost of 4 {{.*}} %V256 = shufflevector
  ; AVX1: cost of 6 {{.*}} %V256 = shufflevector
  ; AVX2: cost of 6 {{.*}} %V256 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V256 = shufflevector
  %V256 = shufflevector <4 x double> %src256, <4 x double> undef, <4 x i32> <i32 3, i32 3, i32 1, i32 0>

  ; SSE2: cost of 24 {{.*}} %V512 = shufflevector
  ; SSSE3: cost of 24 {{.*}} %V512 = shufflevector
  ; SSE42: cost of 24 {{.*}} %V512 = shufflevector
  ; AVX1: cost of 12 {{.*}} %V512 = shufflevector
  ; AVX2: cost of 12 {{.*}} %V512 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V512 = shufflevector
  %V512 = shufflevector <8 x double> %src512, <8 x double> undef, <8 x i32> <i32 7, i32 6, i32 6, i32 4, i32 3, i32 2, i32 1, i32 0>

  ; SSE2: cost of 112 {{.*}} %V1024 = shufflevector
  ; SSSE3: cost of 112 {{.*}} %V1024 = shufflevector
  ; SSE42: cost of 112 {{.*}} %V1024 = shufflevector
  ; AVX1: cost of 72 {{.*}} %V1024 = shufflevector
  ; AVX2: cost of 72 {{.*}} %V1024 = shufflevector
  ; AVX512: cost of 2 {{.*}} %V1024 = shufflevector
  %V1024 = shufflevector <16 x double> %src1024, <16 x double> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 13, i32 11, i32 10, i32 8, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>

  ret void
}

; AVX512-LABEL: 'test_vXi64'
define void @test_vXi64(<4 x i64> %src256, <8 x i64> %src512) {

  ; SSE2: cost of 8 {{.*}} %V256 = shufflevector
  ; SSSE3: cost of 8 {{.*}} %V256 = shufflevector
  ; SSE42: cost of 8 {{.*}} %V256 = shufflevector
  ; AVX1: cost of 8 {{.*}} %V256 = shufflevector
  ; AVX2: cost of 1 {{.*}} %V256 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V256 = shufflevector
  %V256 = shufflevector <4 x i64> %src256, <4 x i64> undef, <4 x i32> <i32 3, i32 3, i32 1, i32 0>

  ; SSE2: cost of 48 {{.*}} %V512 = shufflevector
  ; SSSE3: cost of 48 {{.*}} %V512 = shufflevector
  ; SSE42: cost of 48 {{.*}} %V512 = shufflevector<commit_msg>[CostModel][X86] Added v2f64/v2i64 single src shuffle model tests<commit_after>; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+ssse3 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSSE3
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW

;
; Verify the cost model for 1 src shuffles
;

; CHECK-LABEL: 'test_vXf64'
define void @test_vXf64(<2 x double> %src128, <4 x double> %src256, <8 x double> %src512, <16 x double> %src1024) {

  ; SSE2: cost of 2 {{.*}} %V128 = shufflevector
  ; SSSE3: cost of 2 {{.*}} %V128 = shufflevector
  ; SSE42: cost of 2 {{.*}} %V128 = shufflevector
  ; AVX1: cost of 2 {{.*}} %V128 = shufflevector
  ; AVX2: cost of 2 {{.*}} %V128 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V128 = shufflevector
  %V128 = shufflevector <2 x double> %src128, <2 x double> undef, <2 x i32> <i32 1, i32 1>

  ; SSE2: cost of 4 {{.*}} %V256 = shufflevector
  ; SSSE3: cost of 4 {{.*}} %V256 = shufflevector
  ; SSE42: cost of 4 {{.*}} %V256 = shufflevector
  ; AVX1: cost of 6 {{.*}} %V256 = shufflevector
  ; AVX2: cost of 6 {{.*}} %V256 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V256 = shufflevector
  %V256 = shufflevector <4 x double> %src256, <4 x double> undef, <4 x i32> <i32 3, i32 3, i32 1, i32 0>

  ; SSE2: cost of 24 {{.*}} %V512 = shufflevector
  ; SSSE3: cost of 24 {{.*}} %V512 = shufflevector
  ; SSE42: cost of 24 {{.*}} %V512 = shufflevector
  ; AVX1: cost of 12 {{.*}} %V512 = shufflevector
  ; AVX2: cost of 12 {{.*}} %V512 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V512 = shufflevector
  %V512 = shufflevector <8 x double> %src512, <8 x double> undef, <8 x i32> <i32 7, i32 6, i32 6, i32 4, i32 3, i32 2, i32 1, i32 0>

  ; SSE2: cost of 112 {{.*}} %V1024 = shufflevector
  ; SSSE3: cost of 112 {{.*}} %V1024 = shufflevector
  ; SSE42: cost of 112 {{.*}} %V1024 = shufflevector
  ; AVX1: cost of 72 {{.*}} %V1024 = shufflevector
  ; AVX2: cost of 72 {{.*}} %V1024 = shufflevector
  ; AVX512: cost of 2 {{.*}} %V1024 = shufflevector
  %V1024 = shufflevector <16 x double> %src1024, <16 x double> undef, <16 x i32> <i32 15, i32 14, i32 13, i32 13, i32 11, i32 10, i32 8, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>

  ret void
}

; CHECK-LABEL: 'test_vXi64'
define void @test_vXi64(<2 x i64> %src128, <4 x i64> %src256, <8 x i64> %src512) {

  ; SSE2: cost of 1 {{.*}} %V128 = shufflevector
  ; SSSE3: cost of 1 {{.*}} %V128 = shufflevector
  ; SSE42: cost of 1 {{.*}} %V128 = shufflevector
  ; AVX1: cost of 1 {{.*}} %V128 = shufflevector
  ; AVX2: cost of 1 {{.*}} %V128 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V128 = shufflevector
  %V128 = shufflevector <2 x i64> %src128, <2 x i64> undef, <2 x i32> <i32 1, i32 1>

  ; SSE2: cost of 8 {{.*}} %V256 = shufflevector
  ; SSSE3: cost of 8 {{.*}} %V256 = shufflevector
  ; SSE42: cost of 8 {{.*}} %V256 = shufflevector
  ; AVX1: cost of 8 {{.*}} %V256 = shufflevector
  ; AVX2: cost of 1 {{.*}} %V256 = shufflevector
  ; AVX512: cost of 1 {{.*}} %V256 = shufflevector
  %V256 = shufflevector <4 x i64> %src256, <4 x i64> undef, <4 x i32> <i32 3, i32 3, i32 1, i32 0>

  ; SSE2: cost of 48 {{.*}} %V512 = shufflevector
  ; SSSE3: cost of 48 {{.*}} %V512 = shufflevector
  ; SSE42: cost of 48 {{.*}} %V512 = shufflevector
{'fraction_non_alphanumeric': 0.1760731319554849, 'fraction_numerical': 0.1282458929517753, 'mean_word_length': 3.597442143727162, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6382', 'n_tokens_mistral': 3782, 'n_tokens_neox': 3063, 'n_words': 922}