-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+ssse3 | FileCheck %s --check-prefix=CHECK --check-prefix=SSSE3
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse4.2 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE42
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=AVX
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx2 | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW
-; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512DQ
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+ssse3 | FileCheck %s --check-prefix=CHECK --check-prefix=SSSE3
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse4.2 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE42
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=AVX
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx2 | FileCheck %s --check-prefix=CHECK --check-prefix=AVX2
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW
+; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512DQ
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"
; CHECK-LABEL: 'add'
define i32 @add(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = add
+ %I64 = add i64 undef, undef
; SSSE3: cost of 1 {{.*}} %V2I64 = add
; SSE42: cost of 1 {{.*}} %V2I64 = add
; AVX: cost of 1 {{.*}} %V2I64 = add
; AVX512: cost of 1 {{.*}} %V8I64 = add
%V8I64 = add <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = add
+ %I32 = add i32 undef, undef
; SSSE3: cost of 1 {{.*}} %V4I32 = add
; SSE42: cost of 1 {{.*}} %V4I32 = add
; AVX: cost of 1 {{.*}} %V4I32 = add
; AVX512: cost of 1 {{.*}} %V16I32 = add
%V16I32 = add <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = add
+ %I16 = add i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = add
; SSE42: cost of 1 {{.*}} %V8I16 = add
; AVX: cost of 1 {{.*}} %V8I16 = add
; AVX512BW: cost of 1 {{.*}} %V32I16 = add
%V32I16 = add <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = add
+ %I8 = add i8 undef, undef
; SSSE3: cost of 1 {{.*}} %V16I8 = add
; SSE42: cost of 1 {{.*}} %V16I8 = add
; AVX: cost of 1 {{.*}} %V16I8 = add
; CHECK-LABEL: 'sub'
define i32 @sub(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = sub
+ %I64 = sub i64 undef, undef
; SSSE3: cost of 1 {{.*}} %V2I64 = sub
; SSE42: cost of 1 {{.*}} %V2I64 = sub
; AVX: cost of 1 {{.*}} %V2I64 = sub
; AVX512: cost of 1 {{.*}} %V8I64 = sub
%V8I64 = sub <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = sub
+ %I32 = sub i32 undef, undef
; SSSE3: cost of 1 {{.*}} %V4I32 = sub
; SSE42: cost of 1 {{.*}} %V4I32 = sub
; AVX: cost of 1 {{.*}} %V4I32 = sub
; AVX512: cost of 1 {{.*}} %V16I32 = sub
%V16I32 = sub <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = sub
+ %I16 = sub i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = sub
; SSE42: cost of 1 {{.*}} %V8I16 = sub
; AVX: cost of 1 {{.*}} %V8I16 = sub
; AVX512BW: cost of 1 {{.*}} %V32I16 = sub
%V32I16 = sub <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = sub
+ %I8 = sub i8 undef, undef
; SSSE3: cost of 1 {{.*}} %V16I8 = sub
; SSE42: cost of 1 {{.*}} %V16I8 = sub
; AVX: cost of 1 {{.*}} %V16I8 = sub
; CHECK-LABEL: 'or'
define i32 @or(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = or
+ %I64 = or i64 undef, undef
; SSSE3: cost of 1 {{.*}} %V2I64 = or
; SSE42: cost of 1 {{.*}} %V2I64 = or
; AVX: cost of 1 {{.*}} %V2I64 = or
; AVX512: cost of 1 {{.*}} %V8I64 = or
%V8I64 = or <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = or
+ %I32 = or i32 undef, undef
; SSSE3: cost of 1 {{.*}} %V4I32 = or
; SSE42: cost of 1 {{.*}} %V4I32 = or
; AVX: cost of 1 {{.*}} %V4I32 = or
; AVX512: cost of 1 {{.*}} %V16I32 = or
%V16I32 = or <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = or
+ %I16 = or i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = or
; SSE42: cost of 1 {{.*}} %V8I16 = or
; AVX: cost of 1 {{.*}} %V8I16 = or
; AVX512BW: cost of 1 {{.*}} %V32I16 = or
%V32I16 = or <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = or
+ %I8 = or i8 undef, undef
; SSSE3: cost of 1 {{.*}} %V16I8 = or
; SSE42: cost of 1 {{.*}} %V16I8 = or
; AVX: cost of 1 {{.*}} %V16I8 = or
; CHECK-LABEL: 'xor'
define i32 @xor(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = xor
+ %I64 = xor i64 undef, undef
; SSSE3: cost of 1 {{.*}} %V2I64 = xor
; SSE42: cost of 1 {{.*}} %V2I64 = xor
; AVX: cost of 1 {{.*}} %V2I64 = xor
; AVX512: cost of 1 {{.*}} %V8I64 = xor
%V8I64 = xor <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = xor
+ %I32 = xor i32 undef, undef
; SSSE3: cost of 1 {{.*}} %V4I32 = xor
; SSE42: cost of 1 {{.*}} %V4I32 = xor
; AVX: cost of 1 {{.*}} %V4I32 = xor
; AVX512: cost of 1 {{.*}} %V16I32 = xor
%V16I32 = xor <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = xor
+ %I16 = xor i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = xor
; SSE42: cost of 1 {{.*}} %V8I16 = xor
; AVX: cost of 1 {{.*}} %V8I16 = xor
; AVX512BW: cost of 1 {{.*}} %V32I16 = xor
%V32I16 = xor <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = xor
+ %I8 = xor i8 undef, undef
; SSSE3: cost of 1 {{.*}} %V16I8 = xor
; SSE42: cost of 1 {{.*}} %V16I8 = xor
; AVX: cost of 1 {{.*}} %V16I8 = xor
; CHECK-LABEL: 'and'
define i32 @and(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = and
+ %I64 = and i64 undef, undef
; SSSE3: cost of 1 {{.*}} %V2I64 = and
; SSE42: cost of 1 {{.*}} %V2I64 = and
; AVX: cost of 1 {{.*}} %V2I64 = and
; AVX512: cost of 1 {{.*}} %V8I64 = and
%V8I64 = and <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = and
+ %I32 = and i32 undef, undef
; SSSE3: cost of 1 {{.*}} %V4I32 = and
; SSE42: cost of 1 {{.*}} %V4I32 = and
; AVX: cost of 1 {{.*}} %V4I32 = and
; AVX512: cost of 1 {{.*}} %V16I32 = and
%V16I32 = and <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = and
+ %I16 = and i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = and
; SSE42: cost of 1 {{.*}} %V8I16 = and
; AVX: cost of 1 {{.*}} %V8I16 = and
; AVX512BW: cost of 1 {{.*}} %V32I16 = and
%V32I16 = and <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = and
+ %I8 = and i8 undef, undef
; SSSE3: cost of 1 {{.*}} %V16I8 = and
; SSE42: cost of 1 {{.*}} %V16I8 = and
; AVX: cost of 1 {{.*}} %V16I8 = and
; CHECK-LABEL: 'mul'
define i32 @mul(i32 %arg) {
+ ; CHECK: cost of 1 {{.*}} %I64 = mul
+ %I64 = mul i64 undef, undef
; SSSE3: cost of 8 {{.*}} %V2I64 = mul
; SSE42: cost of 8 {{.*}} %V2I64 = mul
; AVX: cost of 8 {{.*}} %V2I64 = mul
; AVX512DQ: cost of 1 {{.*}} %V8I64 = mul
%V8I64 = mul <8 x i64> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I32 = mul
+ %I32 = mul i32 undef, undef
; SSSE3: cost of 6 {{.*}} %V4I32 = mul
; SSE42: cost of 1 {{.*}} %V4I32 = mul
; AVX: cost of 1 {{.*}} %V4I32 = mul
; AVX512: cost of 1 {{.*}} %V16I32 = mul
%V16I32 = mul <16 x i32> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I16 = mul
+ %I16 = mul i16 undef, undef
; SSSE3: cost of 1 {{.*}} %V8I16 = mul
; SSE42: cost of 1 {{.*}} %V8I16 = mul
; AVX: cost of 1 {{.*}} %V8I16 = mul
; AVX512BW: cost of 1 {{.*}} %V32I16 = mul
%V32I16 = mul <32 x i16> undef, undef
+ ; CHECK: cost of 1 {{.*}} %I8 = mul
+ %I8 = mul i8 undef, undef
; SSSE3: cost of 12 {{.*}} %V16I8 = mul
; SSE42: cost of 12 {{.*}} %V16I8 = mul
; AVX: cost of 12 {{.*}} %V16I8 = mul