~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Analysis/CostModel/X86/scalarize.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
 
 
4
; Test vector scalarization costs.
 
5
; RUN: llc < %s -march=x86 -mcpu=i386
 
6
; RUN: llc < %s -march=x86 -mcpu=yonah
 
7
 
 
8
%i4 = type <4 x i32>
 
9
%i8 = type <2 x i64>
 
10
 
 
11
;;; TEST HANDLING OF VARIOUS VECTOR SIZES
 
12
 
 
13
declare %i4 @llvm.bswap.v4i32(%i4)
 
14
declare %i8 @llvm.bswap.v2i64(%i8)
 
15
 
 
16
declare %i4 @llvm.ctpop.v4i32(%i4)
 
17
declare %i8 @llvm.ctpop.v2i64(%i8)
 
18
 
 
19
; CHECK32-LABEL: test_scalarized_intrinsics
 
20
; CHECK64-LABEL: test_scalarized_intrinsics
 
21
define void @test_scalarized_intrinsics() {
 
22
        %r1 = add %i8 undef, undef
 
23
 
 
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)
 
30
 
 
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)
 
37
 
 
38
; CHECK32: ret
 
39
; CHECK64: ret
 
40
        ret void
 
41
}