-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathout.ir
More file actions
74 lines (65 loc) · 1.4 KB
/
Copy pathout.ir
File metadata and controls
74 lines (65 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// ============================================
// SSA IR pre-optimizacion (frontend output)
// ============================================
// SSA IR - VestaVM
@module vok
@format velb
@function main() -> i32 {
entry_0:
%a = alloca.i8 16
%1 = const.i64 0
store %1, %a
%2 = const.i64 8
%3 = add.i64 %a, %2
%4 = const.i64 0
store %4, %3
%5 = str_lit_addr.ptr
store %5, %a
%6 = const.i64 8
%7 = add.ptr %a, %6
%8 = const.i64 41
store %8, %7
%10 = load.i64 %a
%11 = load.i64 %10
%9 = callind.i64 %11(%a)
%12 = trunc.i32 %9
ret.i32 %12
}
@function vok__A__f(%this: ptr) -> i64 {
entry_0:
%1 = const.i64 8
%2 = add.ptr %this, %1
%3 = load.i64 %2
%4 = const.i64 1
%5 = add.i64 %3, %4
ret.i64 %5
}
// ============================================
// SSA IR post-optimizacion (opt_level=2)
// ============================================
// SSA IR - VestaVM
@module vok
@format velb
@function main() -> i32 {
entry_0:
%6 = const.i64 8
%a = alloca.i8 16
%5 = str_lit_addr.ptr
store %5, %a
%7 = add.ptr %a, %6
%8 = const.i64 41
store %8, %7
%11 = load.i64 %5
%9 = callind.i64 %11(%a)
%12 = trunc.i32 %9
ret.i32 %12
}
@function vok__A__f(%this: ptr) -> i64 {
entry_0:
%1 = const.i64 8
%2 = add.ptr %this, %1
%3 = load.i64 %2
%4 = const.i64 1
%5 = add.i64 %3, %4
ret.i64 %5
}