• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Copyright (c) 2021 Huawei Device Co., Ltd.
2; Licensed under the Apache License, Version 2.0 (the "License");
3; you may not use this file except in compliance with the License.
4; You may obtain a copy of the License at
5;
6; http://www.apache.org/licenses/LICENSE-2.0
7;
8; Unless required by applicable law or agreed to in writing, software
9; distributed under the License is distributed on an "AS IS" BASIS,
10; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11; See the License for the specific language governing permissions and
12; limitations under the License.
13
14define  i32 @main() #0  gc "statepoint-example" {
15entry:
16  %tmp1 = call i8 addrspace(0)* @malloc(i64 8)
17  %tmp2 = call i8 addrspace(0)* @malloc(i64 8)
18  %tmp3 = call i8 addrspace(0)* @malloc(i64 8)
19  %tmp4 = call i8 addrspace(0)* @malloc(i64 8)
20  %tmp5 = call i8 addrspace(0)* @malloc(i64 8)
21  %tmp6 = call i8 addrspace(0)* @malloc(i64 8)
22  %tmp7 = call i8 addrspace(0)* @malloc(i64 8)
23  %tmp8 = call i8 addrspace(0)* @malloc(i64 8)
24  %tmp9 = call i8 addrspace(1)* @_Znam(i64 8)
25
26  %value1 = bitcast i8 addrspace(0)* %tmp1 to i64 addrspace(0)*
27  %value2 = bitcast i8 addrspace(0)* %tmp2 to i64 addrspace(0)*
28  %value3 = bitcast i8 addrspace(0)* %tmp3 to i64 addrspace(0)*
29  %value4 = bitcast i8 addrspace(0)* %tmp4 to i64 addrspace(0)*
30  %value5 = bitcast i8 addrspace(0)* %tmp5 to i64 addrspace(0)*
31  %value6 = bitcast i8 addrspace(0)* %tmp6 to i64 addrspace(0)*
32  %value7 = bitcast i8 addrspace(0)* %tmp7 to i64 addrspace(0)*
33  %value8 = bitcast i8 addrspace(0)* %tmp8 to i64 addrspace(0)*
34  %value9 = bitcast i8 addrspace(1)* %tmp9 to i64 addrspace(1)*
35
36  ;; 0x11223344 --> 287454020
37  store i64 287454020, i64 addrspace(0)* %value1
38  ;; 0x55667788 --> 1432778632‬
39  store i64 1432778632, i64 addrspace(0)* %value2
40  ;; 0x12345678 --> 305419896‬
41  store i64 305419896, i64 addrspace(0)* %value3
42
43  ;; 0x11223344 --> 287454020
44  store i64 287454020, i64 addrspace(0)* %value4
45  ;; 0x55667788 --> 1432778632‬
46  store i64 1432778632, i64 addrspace(0)* %value5
47  ;; 0x12345678 --> 305419896‬
48  store i64 305419896, i64 addrspace(0)* %value6
49  ;; 0x11223344 --> 287454020
50  store i64 287454020, i64 addrspace(0)* %value7
51
52  ;; 0x11223344 --> 287454020
53  store i64 287454020, i64 addrspace(0)* %value8
54  ;; 0x55667788 --> 1432778632‬
55  store i64 1432778632, i64 addrspace(1)* %value9
56
57  call void  @bar(i64 addrspace(0)* %value1, i64 addrspace(0)* %value2, i64 addrspace(0)* %value3, i64 addrspace(0)* %value4, i64 addrspace(0)* %value5, i64 addrspace(0)* %value6, i64 addrspace(0)* %value7, i64 addrspace(0)* %value8, i64 addrspace(1)* %value9)
58
59  ret i32 0
60}
61
62define  void @bar(i64 addrspace(0)* %value, i64 addrspace(0)* %value2, i64 addrspace(0)* %value3, i64 addrspace(0)* %value4, i64 addrspace(0)* %value5, i64 addrspace(0)* %value6, i64 addrspace(0)* %value7, i64 addrspace(0)* %value8, i64 addrspace(1)* %value9) #0  gc "coreclr" {
63entry:
64  %ret = call i64  @test3(i64 addrspace(0)* %value, i64 addrspace(0)* %value2, i64 addrspace(0)* %value3, i64 addrspace(0)* %value4, i64 addrspace(0)* %value5, i64 addrspace(0)* %value6, i64 addrspace(0)* %value7, i64 addrspace(0)* %value8, i64 addrspace(1)* %value9)
65  ret void
66}
67
68define i64  @test3(i64 addrspace(0)* %obj1, i64 addrspace(0)* %obj2, i64 addrspace(0)* %obj3, i64 addrspace(0)* %obj4, i64 addrspace(0)* %obj5, i64 addrspace(0)* %obj6, i64 addrspace(0)* %obj7, i64 addrspace(0)* %obj8, i64 addrspace(1)* %obj9) #0  gc "coreclr" {
69entry:
70  ;call void @DoSafepoint() [ "deopt"() ]
71  call void @DoSafepoint()
72  %obj_1 = load i64, i64 addrspace(0)* %obj1
73  %obj_2 = load i64, i64 addrspace(0)* %obj2
74  %obj_3 = load i64, i64 addrspace(0)* %obj3
75  %obj_4 = load i64, i64 addrspace(0)* %obj4
76  %obj_5 = load i64, i64 addrspace(0)* %obj5
77  %obj_6 = load i64, i64 addrspace(0)* %obj6
78  %obj_7 = load i64, i64 addrspace(0)* %obj7
79  %obj_8 = load i64, i64 addrspace(0)* %obj8
80  %obj_9 = load i64, i64 addrspace(1)* %obj9
81  %result_1 = add i64 %obj_1, %obj_2
82  %result_2 = add i64 %result_1, %obj_3
83  %result_3 = add i64 %result_2, %obj_4
84  %result_4 = add i64 %result_3, %obj_5
85  %result_5 = add i64 %result_4, %obj_6
86  %result_6 = add i64 %result_5, %obj_7
87  %result_7 = add i64 %result_5, %obj_8
88  %result_8 = add i64 %result_5, %obj_9
89  ret i64 %result_8
90}
91
92declare  void @DoSafepoint()
93declare noalias i8 addrspace(1)* @_Znam(i64)
94declare noalias i8* @malloc(i64)
95
96attributes #0 = { "frame-pointer"="all"}
97
98
99
100