forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inlining_optimize-level=3.wast
58 lines (56 loc) · 1.49 KB
/
inlining_optimize-level=3.wast
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
(module
(export "yes" (func $yes))
(export "no-loops-but-one-use-but-exported" (func $no-loops-but-one-use-but-exported))
(table 1 1 funcref)
(elem (i32.const 0) $no-loops-but-one-use-but-tabled)
(func $yes (result i32) ;; inlinable: small, lightweight, even with multi uses and a global use, ok when opt-level=3
(i32.const 1)
)
(func $no-tooBig (result i32)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(i32.const 1)
)
(func $no-calls (result i32)
(call $yes)
)
(func $yes-calls-but-one-use (result i32)
(call $yes)
)
(func $no-loops (result i32)
(loop (result i32)
(i32.const 1)
)
)
(func $yes-loops-but-one-use (result i32)
(loop (result i32)
(i32.const 1)
)
)
(func $no-loops-but-one-use-but-exported (result i32)
(loop (result i32)
(i32.const 1)
)
)
(func $no-loops-but-one-use-but-tabled (result i32)
(loop (result i32)
(i32.const 1)
)
)
(func $intoHere
(drop (call $yes))
(drop (call $no-tooBig))
(drop (call $no-calls))
(drop (call $no-calls))
(drop (call $yes-calls-but-one-use))
(drop (call $no-loops))
(drop (call $no-loops))
(drop (call $yes-loops-but-one-use))
(drop (call $no-loops-but-one-use-but-exported))
(drop (call $no-loops-but-one-use-but-tabled))
)
)