Imported Upstream version 5.18.0.207

Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-17 08:23:10 +00:00
parent 8e12397d70
commit eb85e2fc17
28480 changed files with 72 additions and 3866936 deletions

View File

@ -1,70 +0,0 @@
; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu < %s | FileCheck %s
; Verify the cost of bswap instructions.
declare i16 @llvm.bswap.i16(i16)
declare i32 @llvm.bswap.i32(i32)
declare i64 @llvm.bswap.i64(i64)
declare <2 x i32> @llvm.bswap.v2i32(<2 x i32>)
declare <4 x i16> @llvm.bswap.v4i16(<4 x i16>)
declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
declare <4 x i32> @llvm.bswap.v4i32(<4 x i32>)
declare <8 x i16> @llvm.bswap.v8i16(<8 x i16>)
define i16 @bswap_i16(i16 %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_i16':
; CHECK: Found an estimated cost of 1 for instruction: %bswap
%bswap = tail call i16 @llvm.bswap.i16(i16 %a)
ret i16 %bswap
}
define i32 @bswap_i32(i32 %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_i32':
; CHECK: Found an estimated cost of 1 for instruction: %bswap
%bswap = tail call i32 @llvm.bswap.i32(i32 %a)
ret i32 %bswap
}
define i64 @bswap_i64(i64 %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_i64':
; CHECK: Found an estimated cost of 1 for instruction: %bswap
%bswap = tail call i64 @llvm.bswap.i64(i64 %a)
ret i64 %bswap
}
define <2 x i32> @bswap_v2i32(<2 x i32> %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_v2i32':
; CHECK: Found an estimated cost of 8 for instruction: %bswap
%bswap = call <2 x i32> @llvm.bswap.v2i32(<2 x i32> %a)
ret <2 x i32> %bswap
}
define <4 x i16> @bswap_v4i16(<4 x i16> %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_v4i16':
; CHECK: Found an estimated cost of 22 for instruction: %bswap
%bswap = call <4 x i16> @llvm.bswap.v4i16(<4 x i16> %a)
ret <4 x i16> %bswap
}
define <2 x i64> @bswap_v2i64(<2 x i64> %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_v2i64':
; CHECK: Found an estimated cost of 8 for instruction: %bswap
%bswap = call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %a)
ret <2 x i64> %bswap
}
define <4 x i32> @bswap_v4i32(<4 x i32> %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_v4i32':
; CHECK: Found an estimated cost of 22 for instruction: %bswap
%bswap = call <4 x i32> @llvm.bswap.v4i32(<4 x i32> %a)
ret <4 x i32> %bswap
}
define <8 x i16> @bswap_v8i16(<8 x i16> %a) {
; CHECK: 'Cost Model Analysis' for function 'bswap_v8i16':
; CHECK: Found an estimated cost of 50 for instruction: %bswap
%bswap = call <8 x i16> @llvm.bswap.v8i16(<8 x i16> %a)
ret <8 x i16> %bswap
}

File diff suppressed because it is too large Load Diff

View File

@ -1,292 +0,0 @@
; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu < %s | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-gnu"
define i8 @test1(i8* %p) {
; CHECK-LABEL: test1
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 0
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test2(i16* %p) {
; CHECK-LABEL: test2
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 0
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test3(i32* %p) {
; CHECK-LABEL: test3
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 0
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test4(i64* %p) {
; CHECK-LABEL: test4
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 0
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test5(i8* %p) {
; CHECK-LABEL: test5
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 1024
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test6(i16* %p) {
; CHECK-LABEL: test6
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 1024
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test7(i32* %p) {
; CHECK-LABEL: test7
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 1024
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test8(i64* %p) {
; CHECK-LABEL: test8
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 1024
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test9(i8* %p) {
; CHECK-LABEL: test9
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 4096
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test10(i16* %p) {
; CHECK-LABEL: test10
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 4096
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test11(i32* %p) {
; CHECK-LABEL: test11
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 4096
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test12(i64* %p) {
; CHECK-LABEL: test12
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 4096
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test13(i8* %p) {
; CHECK-LABEL: test13
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 -64
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test14(i16* %p) {
; CHECK-LABEL: test14
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 -64
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test15(i32* %p) {
; CHECK-LABEL: test15
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 -64
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test16(i64* %p) {
; CHECK-LABEL: test16
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 -64
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test17(i8* %p) {
; CHECK-LABEL: test17
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 -1024
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test18(i16* %p) {
; CHECK-LABEL: test18
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 -1024
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test19(i32* %p) {
; CHECK-LABEL: test19
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 -1024
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test20(i64* %p) {
; CHECK-LABEL: test20
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 -1024
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test21(i8* %p, i32 %i) {
; CHECK-LABEL: test21
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 %i
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test22(i16* %p, i32 %i) {
; CHECK-LABEL: test22
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 %i
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test23(i32* %p, i32 %i) {
; CHECK-LABEL: test23
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 %i
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test24(i64* %p, i32 %i) {
; CHECK-LABEL: test24
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 %i
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test25(i8* %p) {
; CHECK-LABEL: test25
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 -128
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test26(i16* %p) {
; CHECK-LABEL: test26
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 -128
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test27(i32* %p) {
; CHECK-LABEL: test27
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 -128
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test28(i64* %p) {
; CHECK-LABEL: test28
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 -128
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test29(i8* %p) {
; CHECK-LABEL: test29
; CHECK: cost of 0 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 -256
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test30(i16* %p) {
; CHECK-LABEL: test30
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 -256
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test31(i32* %p) {
; CHECK-LABEL: test31
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 -256
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test32(i64* %p) {
; CHECK-LABEL: test32
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 -256
%v = load i64, i64* %a
ret i64 %v
}
define i8 @test33(i8* %p) {
; CHECK-LABEL: test33
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i8, i8*
%a = getelementptr inbounds i8, i8* %p, i32 -512
%v = load i8, i8* %a
ret i8 %v
}
define i16 @test34(i16* %p) {
; CHECK-LABEL: test34
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i16, i16*
%a = getelementptr inbounds i16, i16* %p, i32 -512
%v = load i16, i16* %a
ret i16 %v
}
define i32 @test35(i32* %p) {
; CHECK-LABEL: test35
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i32, i32*
%a = getelementptr inbounds i32, i32* %p, i32 -512
%v = load i32, i32* %a
ret i32 %v
}
define i64 @test36(i64* %p) {
; CHECK-LABEL: test36
; CHECK: cost of 1 for instruction: {{.*}} getelementptr inbounds i64, i64*
%a = getelementptr inbounds i64, i64* %p, i32 -512
%v = load i64, i64* %a
ret i64 %v
}

View File

@ -1,26 +0,0 @@
; RUN: opt < %s -cost-model -analyze -mcpu=kryo | FileCheck %s
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-gnu"
; CHECK-LABEL: vectorInstrCost
define void @vectorInstrCost() {
; Vector extracts - extracting the first element should have a zero cost;
; all other elements should have a cost of two.
;
; CHECK: cost of 0 {{.*}} extractelement <2 x i64> undef, i32 0
; CHECK: cost of 2 {{.*}} extractelement <2 x i64> undef, i32 1
%t1 = extractelement <2 x i64> undef, i32 0
%t2 = extractelement <2 x i64> undef, i32 1
; Vector inserts - inserting the first element should have a zero cost; all
; other elements should have a cost of two.
;
; CHECK: cost of 0 {{.*}} insertelement <2 x i64> undef, i64 undef, i32 0
; CHECK: cost of 2 {{.*}} insertelement <2 x i64> undef, i64 undef, i32 1
%t3 = insertelement <2 x i64> undef, i64 undef, i32 0
%t4 = insertelement <2 x i64> undef, i64 undef, i32 1
ret void
}

View File

@ -1,2 +0,0 @@
if not 'AArch64' in config.root.targets:
config.unsupported = True

View File

@ -1,38 +0,0 @@
; RUN: opt < %s -cost-model -analyze -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
; CHECK-LABEL: select
define void @select() {
; Scalar values
; CHECK: cost of 1 {{.*}} select
%v1 = select i1 undef, i8 undef, i8 undef
; CHECK: cost of 1 {{.*}} select
%v2 = select i1 undef, i16 undef, i16 undef
; CHECK: cost of 1 {{.*}} select
%v3 = select i1 undef, i32 undef, i32 undef
; CHECK: cost of 1 {{.*}} select
%v4 = select i1 undef, i64 undef, i64 undef
; CHECK: cost of 1 {{.*}} select
%v5 = select i1 undef, float undef, float undef
; CHECK: cost of 1 {{.*}} select
%v6 = select i1 undef, double undef, double undef
; CHECK: cost of 16 {{.*}} select
%v13b = select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef
; CHECK: cost of 8 {{.*}} select
%v15b = select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef
; CHECK: cost of 16 {{.*}} select
%v15c = select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef
; Vector values - check for vectors of i64s that have a high cost because
; they end up scalarized.
; CHECK: cost of 80 {{.*}} select
%v16a = select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef
; CHECK: cost of 160 {{.*}} select
%v16b = select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef
; CHECK: cost of 320 {{.*}} select
%v16c = select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef
ret void
}

View File

@ -1,70 +0,0 @@
; RUN: opt < %s -cost-model -analyze -mtriple=aarch64-unknown | FileCheck %s
; RUN: opt < %s -cost-model -analyze -mtriple=aarch64-unknown -mattr=slow-misaligned-128store | FileCheck %s --check-prefix=SLOW_MISALIGNED_128_STORE
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
; CHECK-LABEL: getMemoryOpCost
; SLOW_MISALIGNED_128_STORE-LABEL: getMemoryOpCost
define void @getMemoryOpCost() {
; If FeatureSlowMisaligned128Store is set, we penalize 128-bit stores.
; The unlegalized 256-bit stores are further penalized when legalized down
; to 128-bit stores.
; CHECK: cost of 2 for {{.*}} store <4 x i64>
; SLOW_MISALIGNED_128_STORE: cost of 24 for {{.*}} store <4 x i64>
store <4 x i64> undef, <4 x i64> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <8 x i32>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <8 x i32>
store <8 x i32> undef, <8 x i32> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <16 x i16>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <16 x i16>
store <16 x i16> undef, <16 x i16> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <32 x i8>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <32 x i8>
store <32 x i8> undef, <32 x i8> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <4 x double>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <4 x double>
store <4 x double> undef, <4 x double> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <8 x float>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <8 x float>
store <8 x float> undef, <8 x float> * undef
; CHECK-NEXT: cost of 2 for {{.*}} store <16 x half>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 24 for {{.*}} store <16 x half>
store <16 x half> undef, <16 x half> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <2 x i64>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <2 x i64>
store <2 x i64> undef, <2 x i64> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <4 x i32>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <4 x i32>
store <4 x i32> undef, <4 x i32> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <8 x i16>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <8 x i16>
store <8 x i16> undef, <8 x i16> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <16 x i8>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <16 x i8>
store <16 x i8> undef, <16 x i8> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <2 x double>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <2 x double>
store <2 x double> undef, <2 x double> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <4 x float>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <4 x float>
store <4 x float> undef, <4 x float> * undef
; CHECK-NEXT: cost of 1 for {{.*}} store <8 x half>
; SLOW_MISALIGNED_128_STORE-NEXT: cost of 12 for {{.*}} store <8 x half>
store <8 x half> undef, <8 x half> * undef
; We scalarize the loads/stores because there is no vector register name for
; these types (they get extended to v.4h/v.2s).
; CHECK: cost of 16 {{.*}} store
store <2 x i8> undef, <2 x i8> * undef
; CHECK: cost of 64 {{.*}} store
store <4 x i8> undef, <4 x i8> * undef
; CHECK: cost of 16 {{.*}} load
load <2 x i8> , <2 x i8> * undef
; CHECK: cost of 64 {{.*}} load
load <4 x i8> , <4 x i8> * undef
ret void
}