1
; RUN: opt < %s -cost-model -analyze -mtriple=i386 -mcpu=corei7-avx | FileCheck %s -check-prefix=CHECK32
2
; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s -check-prefix=CHECK64
4
; Test vector scalarization costs.
5
; RUN: llc < %s -march=x86 -mcpu=i386
6
; RUN: llc < %s -march=x86 -mcpu=yonah
11
;;; TEST HANDLING OF VARIOUS VECTOR SIZES
13
declare %i4 @llvm.bswap.v4i32(%i4)
14
declare %i8 @llvm.bswap.v2i64(%i8)
16
declare %i4 @llvm.ctpop.v4i32(%i4)
17
declare %i8 @llvm.ctpop.v2i64(%i8)
19
; CHECK32-LABEL: test_scalarized_intrinsics
20
; CHECK64-LABEL: test_scalarized_intrinsics
21
define void @test_scalarized_intrinsics() {
22
%r1 = add %i8 undef, undef
24
; CHECK32: cost of 12 {{.*}}bswap.v4i32
25
; CHECK64: cost of 12 {{.*}}bswap.v4i32
26
%r2 = call %i4 @llvm.bswap.v4i32(%i4 undef)
27
; CHECK32: cost of 10 {{.*}}bswap.v2i64
28
; CHECK64: cost of 6 {{.*}}bswap.v2i64
29
%r3 = call %i8 @llvm.bswap.v2i64(%i8 undef)
31
; CHECK32: cost of 12 {{.*}}ctpop.v4i32
32
; CHECK64: cost of 12 {{.*}}ctpop.v4i32
33
%r4 = call %i4 @llvm.ctpop.v4i32(%i4 undef)
34
; CHECK32: cost of 10 {{.*}}ctpop.v2i64
35
; CHECK64: cost of 6 {{.*}}ctpop.v2i64
36
%r5 = call %i8 @llvm.ctpop.v2i64(%i8 undef)