annotate test/CodeGen/Hexagon/long-calls.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 1172e4bd9c6f
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
1 ; RUN: llc -march=hexagon -enable-save-restore-long < %s | FileCheck %s
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
3 ; Check that the -long-calls feature is supported by the backend.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
5 ; CHECK: call ##foo
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
6 ; CHECK: jump ##__restore
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
7 define i64 @test_longcall(i32 %x, i32 %y) #0 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
8 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
9 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
10 %call = tail call i64 @foo(i32 %add) #6
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
11 %conv = sext i32 %y to i64
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
12 %add1 = add nsw i64 %call, %conv
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
13 ret i64 %add1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
14 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
15
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
16 ; CHECK: jump ##foo
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
17 define i64 @test_longtailcall(i32 %x, i32 %y) #1 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
18 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
19 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
20 %call = tail call i64 @foo(i32 %add) #6
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
21 ret i64 %call
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
22 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
23
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
24 ; CHECK: call ##bar
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
25 define i64 @test_longnoret(i32 %x, i32 %y) #2 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
26 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
27 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
28 %0 = tail call i64 @bar(i32 %add) #7
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
29 unreachable
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
30 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
31
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
32 ; CHECK: call foo
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
33 ; CHECK: jump ##__restore
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
34 ; The restore call will still be long because of the enable-save-restore-long
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
35 ; option being used.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
36 define i64 @test_shortcall(i32 %x, i32 %y) #3 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
37 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
38 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
39 %call = tail call i64 @foo(i32 %add) #6
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
40 %conv = sext i32 %y to i64
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
41 %add1 = add nsw i64 %call, %conv
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
42 ret i64 %add1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
43 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
44
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
45 ; CHECK: jump foo
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
46 define i64 @test_shorttailcall(i32 %x, i32 %y) #4 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
47 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
48 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
49 %call = tail call i64 @foo(i32 %add) #6
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
50 ret i64 %call
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
51 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
52
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
53 ; CHECK: call bar
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
54 define i64 @test_shortnoret(i32 %x, i32 %y) #5 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
55 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
56 %add = add nsw i32 %x, 5
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
57 %0 = tail call i64 @bar(i32 %add) #7
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
58 unreachable
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
59 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
60
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
61 declare i64 @foo(i32) #6
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
62 declare i64 @bar(i32) #7
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
63
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
64 attributes #0 = { minsize nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
65 attributes #1 = { nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
66 attributes #2 = { noreturn nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
67
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
68 attributes #3 = { minsize nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
69 attributes #4 = { nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
70 attributes #5 = { noreturn nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
71
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
72 attributes #6 = { noreturn "target-cpu"="hexagonv60" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
73 attributes #7 = { noreturn nounwind "target-cpu"="hexagonv60" }