forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-folding.wast
More file actions
153 lines (152 loc) · 2.52 KB
/
Copy pathcode-folding.wast
File metadata and controls
153 lines (152 loc) · 2.52 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
(module
(type $13 (func (param f32)))
(table 282 282 anyfunc)
(memory $0 1 1)
(func $0
(block $label$1
(if
(i32.const 1)
(block $label$3
(call_indirect (type $13)
(block $label$4 (result f32) ;; but this type may change dangerously
(nop) ;; fold this
(br $label$3)
)
(i32.const 105)
)
(nop) ;; with this
)
)
)
)
(func $negative-zero (result f32)
(if (result f32)
(i32.const 0)
(block $label$0 (result f32)
(f32.const 0)
)
(block $label$1 (result f32)
(f32.const -0)
)
)
)
(func $negative-zero-b (result f32)
(if (result f32)
(i32.const 0)
(block $label$0 (result f32)
(f32.const -0)
)
(block $label$1 (result f32)
(f32.const -0)
)
)
)
(func $negative-zero-c (result f32)
(if (result f32)
(i32.const 0)
(block $label$0 (result f32)
(f32.const 0)
)
(block $label$1 (result f32)
(f32.const 0)
)
)
)
(func $break-target-outside-of-return-merged-code
(block $label$A
(if
(unreachable)
(block
(block
(block $label$B
(if
(unreachable)
(br_table $label$A $label$B
(unreachable)
)
)
)
(return)
)
)
(block
(block $label$C
(if
(unreachable)
(br_table $label$A $label$C ;; this all looks mergeable, but $label$A is outside
(unreachable)
)
)
)
(return)
)
)
)
)
(func $break-target-inside-all-good
(block $label$A
(if
(unreachable)
(block
(block
(block $label$B
(if
(unreachable)
(br_table $label$B $label$B
(unreachable)
)
)
)
(return)
)
)
(block
(block $label$C
(if
(unreachable)
(br_table $label$C $label$C ;; this all looks mergeable, and is, B ~~ C
(unreachable)
)
)
)
(return)
)
)
)
)
(func $leave-inner-block-type
(block $label$1
(drop
(block $label$2 (result i32) ;; leave this alone (otherwise, if we make it unreachable, we need to do more updating)
(br_if $label$2
(unreachable)
(unreachable)
)
(drop
(i32.const 1)
)
(br $label$1)
)
)
(drop
(i32.const 1)
)
)
)
)
(module
(memory $0 (shared 1 1))
(export "func_2224" (func $0))
(func $0 (result i32)
(local $var$0 i32)
(if (result i32)
(i32.const 0)
(i32.load offset=22
(get_local $var$0)
)
(i32.atomic.load offset=22
(get_local $var$0)
)
)
)
)