Skip to content

Commit 069de1b

Browse files
committed
[CostModel][X86] Regenerate latency/codesize cost tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330052 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7a7d602 commit 069de1b

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed
Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
12
; RUN: opt < %s -cost-model -cost-kind=latency -analyze -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=LATENCY
23
; RUN: opt < %s -cost-model -cost-kind=code-size -analyze -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=CODESIZE
34

@@ -8,48 +9,41 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
89
declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
910

1011
define i64 @foo(i64 %arg) {
11-
12-
; LATENCY: cost of 0 {{.*}} alloca i32
13-
; CODESIZE: cost of 0 {{.*}} alloca i32
12+
; LATENCY-LABEL: 'foo'
13+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
14+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
15+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
16+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = load i64, i64* undef, align 4
17+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
18+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
19+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
20+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
21+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
22+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 40 for instruction: call void undef()
23+
; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
24+
;
25+
; CODESIZE-LABEL: 'foo'
26+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
27+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
28+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
29+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = load i64, i64* undef, align 4
30+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
31+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
32+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
33+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
34+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
35+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: call void undef()
36+
; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
37+
;
1438
%A1 = alloca i32, align 8
15-
16-
; LATENCY: cost of 1 {{.*}} alloca i64, i64 undef
17-
; CODESIZE: cost of 1 {{.*}} alloca i64, i64 undef
1839
%A2 = alloca i64, i64 undef, align 8
19-
20-
; LATENCY: cost of 1 {{.*}} %I64 = add
21-
; CODESIZE: cost of 1 {{.*}} %I64 = add
2240
%I64 = add i64 undef, undef
23-
24-
; LATENCY: cost of 4 {{.*}} load
25-
; CODESIZE: cost of 1 {{.*}} load
2641
load i64, i64* undef, align 4
27-
28-
; LATENCY: cost of 0 {{.*}} bitcast
29-
; CODESIZE: cost of 0 {{.*}} bitcast
3042
%BC = bitcast i8* undef to i32*
31-
32-
; LATENCY: cost of 0 {{.*}} inttoptr
33-
; CODESIZE: cost of 0 {{.*}} inttoptr
3443
%I2P = inttoptr i64 undef to i8*
35-
36-
; LATENCY: cost of 0 {{.*}} ptrtoint
37-
; CODESIZE: cost of 0 {{.*}} ptrtoint
3844
%P2I = ptrtoint i8* undef to i64
39-
40-
; LATENCY: cost of 0 {{.*}} trunc
41-
; CODESIZE: cost of 0 {{.*}} trunc
4245
%TC = trunc i64 undef to i32
43-
44-
; LATENCY: cost of 1 {{.*}} call
45-
; CODESIZE: cost of 1 {{.*}} call
4646
%uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
47-
48-
; LATENCY: cost of 40 {{.*}} call void undef
49-
; CODESIZE: cost of 1 {{.*}} call void undef
5047
call void undef()
51-
52-
; LATENCY: cost of 1 {{.*}} ret
53-
; CODESIZE: cost of 1 {{.*}} ret
5448
ret i64 undef
5549
}

0 commit comments

Comments
 (0)