|
7 | 7 | ;; RUN: foreach %s %t wasm-opt --nominal --monomorphize -all -S -o - | filecheck %s --check-prefix CAREFUL
|
8 | 8 |
|
9 | 9 | (module
|
10 |
| - ;; ALWAYS: (type $A (struct_subtype data)) |
11 |
| - ;; CAREFUL: (type $A (struct_subtype data)) |
| 10 | + ;; ALWAYS: (type $A (struct )) |
| 11 | + ;; CAREFUL: (type $A (struct )) |
12 | 12 | (type $A (struct_subtype data))
|
13 | 13 | ;; ALWAYS: (type $B (struct_subtype $A))
|
14 | 14 | ;; CAREFUL: (type $B (struct_subtype $A))
|
15 | 15 | (type $B (struct_subtype $A))
|
16 | 16 |
|
17 |
| - ;; ALWAYS: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 17 | + ;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A)))) |
18 | 18 |
|
19 |
| - ;; ALWAYS: (type $none_=>_none (func_subtype func)) |
| 19 | + ;; ALWAYS: (type $none_=>_none (func)) |
20 | 20 |
|
21 |
| - ;; ALWAYS: (type $ref|$B|_=>_none (func_subtype (param (ref $B)) func)) |
| 21 | + ;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B)))) |
22 | 22 |
|
23 | 23 | ;; ALWAYS: (import "a" "b" (func $import (param (ref $A))))
|
24 |
| - ;; CAREFUL: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 24 | + ;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A)))) |
25 | 25 |
|
26 |
| - ;; CAREFUL: (type $none_=>_none (func_subtype func)) |
| 26 | + ;; CAREFUL: (type $none_=>_none (func)) |
27 | 27 |
|
28 | 28 | ;; CAREFUL: (import "a" "b" (func $import (param (ref $A))))
|
29 | 29 | (import "a" "b" (func $import (param (ref $A))))
|
|
124 | 124 | ;; As above, but now the refinable function uses the local in a way that
|
125 | 125 | ;; requires a fixup.
|
126 | 126 |
|
127 |
| - ;; ALWAYS: (type $A (struct_subtype data)) |
128 |
| - ;; CAREFUL: (type $none_=>_none (func_subtype func)) |
| 127 | + ;; ALWAYS: (type $A (struct )) |
| 128 | + ;; CAREFUL: (type $none_=>_none (func)) |
129 | 129 |
|
130 |
| - ;; CAREFUL: (type $A (struct_subtype data)) |
| 130 | + ;; CAREFUL: (type $A (struct )) |
131 | 131 | (type $A (struct_subtype data))
|
132 | 132 | ;; ALWAYS: (type $B (struct_subtype $A))
|
133 | 133 | ;; CAREFUL: (type $B (struct_subtype $A))
|
134 | 134 | (type $B (struct_subtype $A))
|
135 | 135 |
|
136 | 136 |
|
137 | 137 |
|
138 |
| - ;; ALWAYS: (type $none_=>_none (func_subtype func)) |
| 138 | + ;; ALWAYS: (type $none_=>_none (func)) |
139 | 139 |
|
140 |
| - ;; ALWAYS: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 140 | + ;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A)))) |
141 | 141 |
|
142 |
| - ;; ALWAYS: (type $ref|$B|_=>_none (func_subtype (param (ref $B)) func)) |
| 142 | + ;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B)))) |
143 | 143 |
|
144 | 144 | ;; ALWAYS: (func $calls (type $none_=>_none)
|
145 | 145 | ;; ALWAYS-NEXT: (call $refinable_0
|
146 | 146 | ;; ALWAYS-NEXT: (struct.new_default $B)
|
147 | 147 | ;; ALWAYS-NEXT: )
|
148 | 148 | ;; ALWAYS-NEXT: )
|
149 |
| - ;; CAREFUL: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 149 | + ;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A)))) |
150 | 150 |
|
151 | 151 | ;; CAREFUL: (func $calls (type $none_=>_none)
|
152 | 152 | ;; CAREFUL-NEXT: (call $refinable
|
|
204 | 204 | (module
|
205 | 205 | ;; Multiple refinings of the same function, and of different functions.
|
206 | 206 |
|
207 |
| - ;; ALWAYS: (type $A (struct_subtype data)) |
208 |
| - ;; CAREFUL: (type $none_=>_none (func_subtype func)) |
| 207 | + ;; ALWAYS: (type $A (struct )) |
| 208 | + ;; CAREFUL: (type $none_=>_none (func)) |
209 | 209 |
|
210 |
| - ;; CAREFUL: (type $A (struct_subtype data)) |
| 210 | + ;; CAREFUL: (type $A (struct )) |
211 | 211 | (type $A (struct_subtype data))
|
212 | 212 | ;; ALWAYS: (type $B (struct_subtype $A))
|
213 | 213 | ;; CAREFUL: (type $B (struct_subtype $A))
|
214 | 214 | (type $B (struct_subtype $A))
|
215 | 215 |
|
216 |
| - ;; ALWAYS: (type $none_=>_none (func_subtype func)) |
| 216 | + ;; ALWAYS: (type $none_=>_none (func)) |
217 | 217 |
|
218 | 218 | ;; ALWAYS: (type $C (struct_subtype $B))
|
219 |
| - ;; CAREFUL: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 219 | + ;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A)))) |
220 | 220 |
|
221 | 221 | ;; CAREFUL: (type $C (struct_subtype $B))
|
222 | 222 | (type $C (struct_subtype $B))
|
223 | 223 |
|
224 |
| - ;; ALWAYS: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 224 | + ;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A)))) |
225 | 225 |
|
226 |
| - ;; ALWAYS: (type $ref|$B|_=>_none (func_subtype (param (ref $B)) func)) |
| 226 | + ;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B)))) |
227 | 227 |
|
228 |
| - ;; ALWAYS: (type $ref|$C|_=>_none (func_subtype (param (ref $C)) func)) |
| 228 | + ;; ALWAYS: (type $ref|$C|_=>_none (func (param (ref $C)))) |
229 | 229 |
|
230 | 230 | ;; ALWAYS: (func $calls1 (type $none_=>_none)
|
231 | 231 | ;; ALWAYS-NEXT: (call $refinable1
|
|
327 | 327 | ;; A case where even CAREFUL mode will monomorphize, as it helps the target
|
328 | 328 | ;; function get optimized better.
|
329 | 329 |
|
330 |
| - ;; ALWAYS: (type $A (struct_subtype data)) |
331 |
| - ;; CAREFUL: (type $A (struct_subtype data)) |
| 330 | + ;; ALWAYS: (type $A (struct )) |
| 331 | + ;; CAREFUL: (type $A (struct )) |
332 | 332 | (type $A (struct_subtype data))
|
333 | 333 |
|
334 | 334 | ;; ALWAYS: (type $B (struct_subtype $A))
|
335 | 335 | ;; CAREFUL: (type $B (struct_subtype $A))
|
336 | 336 | (type $B (struct_subtype $A))
|
337 | 337 |
|
338 |
| - ;; ALWAYS: (type $ref|$B|_=>_none (func_subtype (param (ref $B)) func)) |
| 338 | + ;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B)))) |
339 | 339 |
|
340 |
| - ;; ALWAYS: (type $none_=>_none (func_subtype func)) |
| 340 | + ;; ALWAYS: (type $none_=>_none (func)) |
341 | 341 |
|
342 |
| - ;; ALWAYS: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 342 | + ;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A)))) |
343 | 343 |
|
344 | 344 | ;; ALWAYS: (import "a" "b" (func $import (param (ref $B))))
|
345 | 345 |
|
346 | 346 | ;; ALWAYS: (global $global (mut i32) (i32.const 1))
|
347 |
| - ;; CAREFUL: (type $ref|$B|_=>_none (func_subtype (param (ref $B)) func)) |
| 347 | + ;; CAREFUL: (type $ref|$B|_=>_none (func (param (ref $B)))) |
348 | 348 |
|
349 |
| - ;; CAREFUL: (type $none_=>_none (func_subtype func)) |
| 349 | + ;; CAREFUL: (type $none_=>_none (func)) |
350 | 350 |
|
351 |
| - ;; CAREFUL: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 351 | + ;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A)))) |
352 | 352 |
|
353 | 353 | ;; CAREFUL: (import "a" "b" (func $import (param (ref $B))))
|
354 | 354 |
|
|
558 | 558 | (module
|
559 | 559 | ;; Test that we avoid recursive calls.
|
560 | 560 |
|
561 |
| - ;; ALWAYS: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 561 | + ;; ALWAYS: (type $ref|$A|_=>_none (func (param (ref $A)))) |
562 | 562 |
|
563 |
| - ;; ALWAYS: (type $A (struct_subtype data)) |
564 |
| - ;; CAREFUL: (type $ref|$A|_=>_none (func_subtype (param (ref $A)) func)) |
| 563 | + ;; ALWAYS: (type $A (struct )) |
| 564 | + ;; CAREFUL: (type $ref|$A|_=>_none (func (param (ref $A)))) |
565 | 565 |
|
566 |
| - ;; CAREFUL: (type $A (struct_subtype data)) |
| 566 | + ;; CAREFUL: (type $A (struct )) |
567 | 567 | (type $A (struct_subtype data))
|
568 | 568 | ;; ALWAYS: (type $B (struct_subtype $A))
|
569 | 569 | ;; CAREFUL: (type $B (struct_subtype $A))
|
|
0 commit comments