summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-07-30 17:36:12 -0700
committerGitHub <noreply@github.com>2018-07-30 17:36:12 -0700
commit353e2c4fcb7662b8c73f5673fd0fc21bcb7287c6 (patch)
treeeda3800dcd9751f29492fc5732f4af41c0e473c8 /test
parent0483d81ad9a665d404f2e2182e718ccbf0592be7 (diff)
downloadbinaryen-353e2c4fcb7662b8c73f5673fd0fc21bcb7287c6.tar.gz
binaryen-353e2c4fcb7662b8c73f5673fd0fc21bcb7287c6.tar.bz2
binaryen-353e2c4fcb7662b8c73f5673fd0fc21bcb7287c6.zip
Stack IR (#1623)
This adds a new IR, "Stack IR". This represents wasm at a very low level, as a simple stream of instructions, basically the same as wasm's binary format. This is unlike Binaryen IR which is structured and in a tree format. This gives some small wins on binary sizes, less than 1% in most cases, usually 0.25-0.50% or so. That's not much by itself, but looking forward this prepares us for multi-value, which we really need an IR like this to be able to optimize well. Also, it's possible there is more we can do already - currently there are just a few stack IR optimizations implemented, DCE local2stack - check if a set_local/get_local pair can be removed, which keeps the set's value on the stack, which if the stars align it can be popped instead of the get. Block removal - remove any blocks with no branches, as they are valid in wasm binary format. Implementation-wise, the IR is defined in wasm-stack.h. A new StackInst is defined, representing a single instruction. Most are simple reflections of Binaryen IR (an add, a load, etc.), and just pointers to them. Control flow constructs are expanded into multiple instructions, like a block turns into a block begin and end, and we may also emit extra unreachables to handle the fact Binaryen IR has unreachable blocks/ifs/loops but wasm does not. Overall, all the Binaryen IR differences with wasm vanish on the way to stack IR. Where this IR lives: Each Function now has a unique_ptr to stack IR, that is, a function may have stack IR alongside the main IR. If the stack IR is present, we write it out during binary writing; if not, we do the same binaryen IR => wasm binary process as before (this PR should not affect speed there). This design lets us use normal Passes on stack IR, in particular this PR defines 3 passes: Generate stack IR Optimize stack IR (might be worth splitting out into separate passes eventually) Print stack IR for debugging purposes Having these as normal passes is convenient as then they can run in parallel across functions and all the other conveniences of our current Pass system. However, a downside of keeping the second IR as an option on Functions, and using normal Passes to operate on it, means that we may get out of sync: if you generate stack IR, then modify binaryen IR, then the stack IR may no longer be valid (for example, maybe you removed locals or modified instructions in place etc.). To avoid that, Passes now define if they modify Binaryen IR or not; if they do, we throw away the stack IR. Miscellaneous notes: Just writing Stack IR, then writing to binary - no optimizations - is 20% slower than going directly to binary, which is one reason why we still support direct writing. This does lead to some "fun" C++ template code to make that convenient: there is a single StackWriter class, templated over the "mode", which is either Binaryen2Binary (direct writing), Binaryen2Stack, or Stack2Binary. This avoids a lot of boilerplate as the 3 modes share a lot of code in overlapping ways. Stack IR does not support source maps / debug info. We just don't use that IR if debug info is present. A tiny text format comment (if emitting non-minified text) indicates stack IR is present, if it is ((; has Stack IR ;)). This may help with debugging, just in case people forget. There is also a pass to print out the stack IR for debug purposes, as mentioned above. The sieve binaryen.js test was actually not validating all along - these new opts broke it in a more noticeable manner. Fixed. Added extra checks in pass-debug mode, to verify that if stack IR should have been thrown out, it was. This should help avoid any confusion with the IR being invalid. Added a comment about the possible future of stack IR as the main IR, depending on optimization results, following some discussion earlier today.
Diffstat (limited to 'test')
-rw-r--r--test/bad_params.fromasm2
-rw-r--r--test/bad_params.fromasm.clamp2
-rw-r--r--test/bad_params.fromasm.imprecise2
-rw-r--r--test/binaryen.js/hello-world.js.txt2
-rw-r--r--test/binaryen.js/optimize-levels.js.txt4
-rw-r--r--test/binaryen.js/sieve.js26
-rw-r--r--test/binaryen.js/sieve.js.txt38
-rw-r--r--test/debugInfo.fromasm14
-rw-r--r--test/debugInfo.fromasm.clamp14
-rw-r--r--test/debugInfo.fromasm.imprecise12
-rw-r--r--test/dynamicLibrary.fromasm6
-rw-r--r--test/dynamicLibrary.fromasm.clamp6
-rw-r--r--test/dynamicLibrary.fromasm.imprecise6
-rw-r--r--test/emcc_O2_hello_world.fromasm68
-rw-r--r--test/emcc_O2_hello_world.fromasm.clamp68
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise68
-rw-r--r--test/emcc_hello_world.fromasm102
-rw-r--r--test/emcc_hello_world.fromasm.clamp106
-rw-r--r--test/emcc_hello_world.fromasm.imprecise96
-rw-r--r--test/example/relooper-fuzz.txt4
-rw-r--r--test/example/relooper-fuzz1.txt4
-rw-r--r--test/hello_world.fromasm2
-rw-r--r--test/hello_world.fromasm.clamp2
-rw-r--r--test/hello_world.fromasm.imprecise2
-rw-r--r--test/i64-setTempRet0.fromasm4
-rw-r--r--test/i64-setTempRet0.fromasm.clamp4
-rw-r--r--test/i64-setTempRet0.fromasm.imprecise4
-rw-r--r--test/importedSignCast.fromasm2
-rw-r--r--test/importedSignCast.fromasm.clamp2
-rw-r--r--test/importedSignCast.fromasm.imprecise2
-rw-r--r--test/memorygrowth-minimal.fromasm2
-rw-r--r--test/memorygrowth-minimal.fromasm.clamp2
-rw-r--r--test/memorygrowth-minimal.fromasm.imprecise2
-rw-r--r--test/memorygrowth.fromasm72
-rw-r--r--test/memorygrowth.fromasm.clamp72
-rw-r--r--test/memorygrowth.fromasm.imprecise72
-rw-r--r--test/min.fromasm10
-rw-r--r--test/min.fromasm.clamp10
-rw-r--r--test/min.fromasm.imprecise10
-rw-r--r--test/noffi_f32.fromasm4
-rw-r--r--test/noffi_f32.fromasm.clamp4
-rw-r--r--test/noffi_f32.fromasm.imprecise4
-rw-r--r--test/noffi_i64.fromasm4
-rw-r--r--test/noffi_i64.fromasm.clamp4
-rw-r--r--test/noffi_i64.fromasm.imprecise4
-rw-r--r--test/passes/O.bin.txt10
-rw-r--r--test/passes/O.txt4
-rw-r--r--test/passes/O1_print-stack-ir.txt29
-rw-r--r--test/passes/O1_print-stack-ir.wast16
-rw-r--r--test/passes/O2_precompute-propagate_print-stack-ir.txt16
-rw-r--r--test/passes/O2_precompute-propagate_print-stack-ir.wast18
-rw-r--r--test/passes/O2_print-stack-ir.txt40
-rw-r--r--test/passes/O2_print-stack-ir.wast16
-rw-r--r--test/passes/O3_print-stack-ir.txt38
-rw-r--r--test/passes/O3_print-stack-ir.wast16
-rw-r--r--test/passes/O4.txt2
-rw-r--r--test/passes/Os_print-stack-ir.txt38
-rw-r--r--test/passes/Os_print-stack-ir.wast16
-rw-r--r--test/passes/Oz.txt4
-rw-r--r--test/passes/converge_O3_metrics.bin.txt36
-rw-r--r--test/passes/flatten_local-cse_Os.txt2
-rw-r--r--test/passes/fuzz-exec_O.txt4
-rw-r--r--test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt1540
-rw-r--r--test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.wast712
-rw-r--r--test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt41
-rw-r--r--test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.wast21
-rw-r--r--test/threads.fromasm2
-rw-r--r--test/threads.fromasm.clamp2
-rw-r--r--test/threads.fromasm.imprecise2
-rw-r--r--test/threads.wasm-only.fromasm8
-rw-r--r--test/threads.wasm-only.fromasm.clamp8
-rw-r--r--test/threads.wasm-only.fromasm.imprecise8
-rw-r--r--test/two_sides.fromasm2
-rw-r--r--test/two_sides.fromasm.clamp4
-rw-r--r--test/two_sides.fromasm.imprecise2
-rw-r--r--test/unit.fromasm110
-rw-r--r--test/unit.fromasm.clamp116
-rw-r--r--test/unit.fromasm.imprecise110
-rw-r--r--test/unreachable-import_wasm-only.fromasm2
-rw-r--r--test/unreachable-import_wasm-only.fromasm.clamp2
-rw-r--r--test/unreachable-import_wasm-only.fromasm.imprecise2
-rw-r--r--test/wasm-only.fromasm54
-rw-r--r--test/wasm-only.fromasm.clamp54
-rw-r--r--test/wasm-only.fromasm.imprecise42
84 files changed, 3332 insertions, 767 deletions
diff --git a/test/bad_params.fromasm b/test/bad_params.fromasm
index 52f804340..1862f5ffe 100644
--- a/test/bad_params.fromasm
+++ b/test/bad_params.fromasm
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "bad_params.asm.js")
(export "ex" (func $ex))
- (func $ex (; 0 ;)
+ (func $ex (; 0 ;) (; has Stack IR ;)
(nop)
)
)
diff --git a/test/bad_params.fromasm.clamp b/test/bad_params.fromasm.clamp
index 52f804340..1862f5ffe 100644
--- a/test/bad_params.fromasm.clamp
+++ b/test/bad_params.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "bad_params.asm.js")
(export "ex" (func $ex))
- (func $ex (; 0 ;)
+ (func $ex (; 0 ;) (; has Stack IR ;)
(nop)
)
)
diff --git a/test/bad_params.fromasm.imprecise b/test/bad_params.fromasm.imprecise
index ae5256c57..d174d5614 100644
--- a/test/bad_params.fromasm.imprecise
+++ b/test/bad_params.fromasm.imprecise
@@ -1,6 +1,6 @@
(module
(export "ex" (func $ex))
- (func $ex (; 0 ;)
+ (func $ex (; 0 ;) (; has Stack IR ;)
(nop)
)
)
diff --git a/test/binaryen.js/hello-world.js.txt b/test/binaryen.js/hello-world.js.txt
index c3cfae20b..dcdb21e80 100644
--- a/test/binaryen.js/hello-world.js.txt
+++ b/test/binaryen.js/hello-world.js.txt
@@ -16,7 +16,7 @@ optimized:
(module
(type $iii (func (param i32 i32) (result i32)))
(export "adder" (func $adder))
- (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
+ (func $adder (; 0 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
diff --git a/test/binaryen.js/optimize-levels.js.txt b/test/binaryen.js/optimize-levels.js.txt
index 78190fc0d..8cb0dfea5 100644
--- a/test/binaryen.js/optimize-levels.js.txt
+++ b/test/binaryen.js/optimize-levels.js.txt
@@ -36,7 +36,7 @@ shrinkLevel=1
(module
(type $i (func (param i32) (result i32)))
(export "test" (func $test))
- (func $test (; 0 ;) (type $i) (param $0 i32) (result i32)
+ (func $test (; 0 ;) (; has Stack IR ;) (type $i) (param $0 i32) (result i32)
(select
(get_local $0)
(i32.const 0)
@@ -66,7 +66,7 @@ shrinkLevel=1
(module
(type $i (func (param i32) (result i32)))
(export "test" (func $test))
- (func $test (; 0 ;) (type $i) (param $0 i32) (result i32)
+ (func $test (; 0 ;) (; has Stack IR ;) (type $i) (param $0 i32) (result i32)
(select
(get_local $0)
(i32.const 0)
diff --git a/test/binaryen.js/sieve.js b/test/binaryen.js/sieve.js
index a7f0c993b..4c1e5eefc 100644
--- a/test/binaryen.js/sieve.js
+++ b/test/binaryen.js/sieve.js
@@ -19,16 +19,18 @@ var body = module.block(
),
module.get_local(0, Binaryen.i32)
),
- module.grow_memory(
- module.i32.sub(
- module.i32.div_u(
- module.i32.add(
- module.get_local(0, Binaryen.i32),
- module.i32.const(65535)
+ module.drop(
+ module.grow_memory(
+ module.i32.sub(
+ module.i32.div_u(
+ module.i32.add(
+ module.get_local(0, Binaryen.i32),
+ module.i32.const(65535)
+ ),
+ module.i32.const(65536)
),
- module.i32.const(65536)
- ),
- module.current_memory()
+ module.current_memory()
+ )
)
)
),
@@ -44,8 +46,8 @@ var body = module.block(
module.i32.const(1)
)),
module.br_if('clear', module.i32.eq(
- module.get_local(1),
- module.get_local(0)
+ module.get_local(1, Binaryen.i32),
+ module.get_local(0, Binaryen.i32)
))
])),
// perform the sieve TODO
@@ -63,6 +65,8 @@ module.addFunction('sieve', ii, [Binaryen.i32], body);
// export it as the same name as it has internally)
module.addFunctionExport('sieve', 'sieve');
+if (!module.validate()) throw 'did not validate :(';
+
// Print out the text
console.log(module.emitText());
diff --git a/test/binaryen.js/sieve.js.txt b/test/binaryen.js/sieve.js.txt
index 2c4b906dd..97816e6b3 100644
--- a/test/binaryen.js/sieve.js.txt
+++ b/test/binaryen.js/sieve.js.txt
@@ -12,16 +12,18 @@
)
(get_local $0)
)
- (grow_memory
- (i32.sub
- (i32.div_u
- (i32.add
- (get_local $0)
- (i32.const 65535)
+ (drop
+ (grow_memory
+ (i32.sub
+ (i32.div_u
+ (i32.add
+ (get_local $0)
+ (i32.const 65535)
+ )
+ (i32.const 65536)
)
- (i32.const 65536)
+ (current_memory)
)
- (current_memory)
)
)
)
@@ -58,7 +60,7 @@ optimized:
(type $i (func (param i32) (result i32)))
(memory $0 1 100)
(export "sieve" (func $sieve))
- (func $sieve (; 0 ;) (type $i) (param $0 i32) (result i32)
+ (func $sieve (; 0 ;) (; has Stack IR ;) (type $i) (param $0 i32) (result i32)
(local $1 i32)
(if
(i32.lt_u
@@ -68,16 +70,18 @@ optimized:
)
(get_local $0)
)
- (grow_memory
- (i32.sub
- (i32.div_u
- (i32.add
- (get_local $0)
- (i32.const 65535)
+ (drop
+ (grow_memory
+ (i32.sub
+ (i32.div_u
+ (i32.add
+ (get_local $0)
+ (i32.const 65535)
+ )
+ (i32.const 65536)
)
- (i32.const 65536)
+ (current_memory)
)
- (current_memory)
)
)
)
diff --git a/test/debugInfo.fromasm b/test/debugInfo.fromasm
index 0f104af84..5bedd5bdf 100644
--- a/test/debugInfo.fromasm
+++ b/test/debugInfo.fromasm
@@ -8,14 +8,14 @@
(export "fib" (func $fib))
(export "switch_reach" (func $switch_reach))
(export "nofile" (func $nofile))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ tests/other_file.cpp:314159:0
(i32.add
(get_local $1)
(get_local $1)
)
)
- (func $ret (; 1 ;) (param $0 i32) (result i32)
+ (func $ret (; 1 ;) (; has Stack IR ;) (param $0 i32) (result i32)
;;@ return.cpp:50:0
(set_local $0
(i32.shl
@@ -29,7 +29,7 @@
(i32.const 1)
)
)
- (func $i32s-rem (; 2 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32s-rem (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.rem_s
@@ -39,7 +39,7 @@
(i32.const 0)
)
)
- (func $opts (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $opts (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ even-opted.cpp:1:0
(set_local $0
(i32.add
@@ -63,7 +63,7 @@
(get_local $1)
)
)
- (func $fib (; 4 ;) (param $0 i32) (result i32)
+ (func $fib (; 4 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -126,7 +126,7 @@
;;@ fib.c:8:0
(get_local $1)
)
- (func $switch_reach (; 5 ;) (param $0 i32) (result i32)
+ (func $switch_reach (; 5 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(block $__rjto$0 (result i32)
@@ -180,7 +180,7 @@
;;@ /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950:0
(get_local $1)
)
- (func $nofile (; 6 ;)
+ (func $nofile (; 6 ;) (; has Stack IR ;)
;;@ (unknown):1337:0
(call $nofile)
)
diff --git a/test/debugInfo.fromasm.clamp b/test/debugInfo.fromasm.clamp
index 0f104af84..5bedd5bdf 100644
--- a/test/debugInfo.fromasm.clamp
+++ b/test/debugInfo.fromasm.clamp
@@ -8,14 +8,14 @@
(export "fib" (func $fib))
(export "switch_reach" (func $switch_reach))
(export "nofile" (func $nofile))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ tests/other_file.cpp:314159:0
(i32.add
(get_local $1)
(get_local $1)
)
)
- (func $ret (; 1 ;) (param $0 i32) (result i32)
+ (func $ret (; 1 ;) (; has Stack IR ;) (param $0 i32) (result i32)
;;@ return.cpp:50:0
(set_local $0
(i32.shl
@@ -29,7 +29,7 @@
(i32.const 1)
)
)
- (func $i32s-rem (; 2 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32s-rem (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.rem_s
@@ -39,7 +39,7 @@
(i32.const 0)
)
)
- (func $opts (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $opts (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ even-opted.cpp:1:0
(set_local $0
(i32.add
@@ -63,7 +63,7 @@
(get_local $1)
)
)
- (func $fib (; 4 ;) (param $0 i32) (result i32)
+ (func $fib (; 4 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -126,7 +126,7 @@
;;@ fib.c:8:0
(get_local $1)
)
- (func $switch_reach (; 5 ;) (param $0 i32) (result i32)
+ (func $switch_reach (; 5 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(block $__rjto$0 (result i32)
@@ -180,7 +180,7 @@
;;@ /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950:0
(get_local $1)
)
- (func $nofile (; 6 ;)
+ (func $nofile (; 6 ;) (; has Stack IR ;)
;;@ (unknown):1337:0
(call $nofile)
)
diff --git a/test/debugInfo.fromasm.imprecise b/test/debugInfo.fromasm.imprecise
index 9cad26249..a52606e16 100644
--- a/test/debugInfo.fromasm.imprecise
+++ b/test/debugInfo.fromasm.imprecise
@@ -5,14 +5,14 @@
(export "fib" (func $fib))
(export "switch_reach" (func $switch_reach))
(export "nofile" (func $nofile))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ tests/other_file.cpp:314159:0
(i32.add
(get_local $1)
(get_local $1)
)
)
- (func $ret (; 1 ;) (param $0 i32) (result i32)
+ (func $ret (; 1 ;) (; has Stack IR ;) (param $0 i32) (result i32)
;;@ return.cpp:50:0
(set_local $0
(i32.shl
@@ -26,7 +26,7 @@
(i32.const 1)
)
)
- (func $opts (; 2 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $opts (; 2 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;;@ even-opted.cpp:1:0
(set_local $0
(i32.add
@@ -50,7 +50,7 @@
(get_local $1)
)
)
- (func $fib (; 3 ;) (param $0 i32) (result i32)
+ (func $fib (; 3 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -113,7 +113,7 @@
;;@ fib.c:8:0
(get_local $1)
)
- (func $switch_reach (; 4 ;) (param $0 i32) (result i32)
+ (func $switch_reach (; 4 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(block $__rjto$0 (result i32)
@@ -167,7 +167,7 @@
;;@ /tmp/emscripten_test_binaryen2_28hnAe/src.c:59950:0
(get_local $1)
)
- (func $nofile (; 5 ;)
+ (func $nofile (; 5 ;) (; has Stack IR ;)
;;@ (unknown):1337:0
(call $nofile)
)
diff --git a/test/dynamicLibrary.fromasm b/test/dynamicLibrary.fromasm
index 295451b4c..edd7a60d0 100644
--- a/test/dynamicLibrary.fromasm
+++ b/test/dynamicLibrary.fromasm
@@ -13,7 +13,7 @@
(export "__post_instantiate" (func $__post_instantiate))
(export "runPostSets" (func $runPostSets))
(export "_global" (global $_global))
- (func $__ZN3FooC2Ev (; 2 ;) (param $0 i32)
+ (func $__ZN3FooC2Ev (; 2 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -42,10 +42,10 @@
(get_local $1)
)
)
- (func $runPostSets (; 3 ;)
+ (func $runPostSets (; 3 ;) (; has Stack IR ;)
(nop)
)
- (func $__post_instantiate (; 4 ;)
+ (func $__post_instantiate (; 4 ;) (; has Stack IR ;)
(set_global $STACKTOP
(i32.add
(get_global $memoryBase)
diff --git a/test/dynamicLibrary.fromasm.clamp b/test/dynamicLibrary.fromasm.clamp
index 295451b4c..edd7a60d0 100644
--- a/test/dynamicLibrary.fromasm.clamp
+++ b/test/dynamicLibrary.fromasm.clamp
@@ -13,7 +13,7 @@
(export "__post_instantiate" (func $__post_instantiate))
(export "runPostSets" (func $runPostSets))
(export "_global" (global $_global))
- (func $__ZN3FooC2Ev (; 2 ;) (param $0 i32)
+ (func $__ZN3FooC2Ev (; 2 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -42,10 +42,10 @@
(get_local $1)
)
)
- (func $runPostSets (; 3 ;)
+ (func $runPostSets (; 3 ;) (; has Stack IR ;)
(nop)
)
- (func $__post_instantiate (; 4 ;)
+ (func $__post_instantiate (; 4 ;) (; has Stack IR ;)
(set_global $STACKTOP
(i32.add
(get_global $memoryBase)
diff --git a/test/dynamicLibrary.fromasm.imprecise b/test/dynamicLibrary.fromasm.imprecise
index 58d9559ad..ce18a050f 100644
--- a/test/dynamicLibrary.fromasm.imprecise
+++ b/test/dynamicLibrary.fromasm.imprecise
@@ -11,7 +11,7 @@
(export "__post_instantiate" (func $__post_instantiate))
(export "runPostSets" (func $runPostSets))
(export "_global" (global $_global))
- (func $__ZN3FooC2Ev (; 2 ;) (param $0 i32)
+ (func $__ZN3FooC2Ev (; 2 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -40,10 +40,10 @@
(get_local $1)
)
)
- (func $runPostSets (; 3 ;)
+ (func $runPostSets (; 3 ;) (; has Stack IR ;)
(nop)
)
- (func $__post_instantiate (; 4 ;)
+ (func $__post_instantiate (; 4 ;) (; has Stack IR ;)
(set_global $STACKTOP
(i32.add
(get_global $memoryBase)
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index cd097028a..0566193d0 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -51,7 +51,7 @@
(export "dynCall_ii" (func $dynCall_ii))
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
- (func $_malloc (; 15 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 15 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5830,7 +5830,7 @@
)
(i32.const 0)
)
- (func $_free (; 16 ;) (param $0 i32)
+ (func $_free (; 16 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7651,7 +7651,7 @@
(i32.const -1)
)
)
- (func $___stdio_write (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8025,7 +8025,7 @@
)
(get_local $15)
)
- (func $___fwritex (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8237,7 +8237,7 @@
)
(get_local $4)
)
- (func $_fflush (; 19 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -8344,7 +8344,7 @@
)
(get_local $1)
)
- (func $_strlen (; 20 ;) (param $0 i32) (result i32)
+ (func $_strlen (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8488,7 +8488,7 @@
(get_local $3)
)
)
- (func $___overflow (; 21 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $___overflow (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8642,7 +8642,7 @@
)
(get_local $4)
)
- (func $___fflush_unlocked (; 22 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 22 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8765,7 +8765,7 @@
)
)
)
- (func $_memcpy (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8912,10 +8912,10 @@
)
(get_local $3)
)
- (func $runPostSets (; 24 ;)
+ (func $runPostSets (; 24 ;) (; has Stack IR ;)
(nop)
)
- (func $_memset (; 25 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 25 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9053,7 +9053,7 @@
(get_local $2)
)
)
- (func $_puts (; 26 ;) (param $0 i32) (result i32)
+ (func $_puts (; 26 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -9145,7 +9145,7 @@
(i32.const 31)
)
)
- (func $___stdio_seek (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9214,7 +9214,7 @@
)
(get_local $0)
)
- (func $___towrite (; 28 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 28 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9292,7 +9292,7 @@
)
)
)
- (func $_fwrite (; 29 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_fwrite (; 29 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9331,7 +9331,7 @@
)
(get_local $2)
)
- (func $___stdout_write (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 30 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9400,7 +9400,7 @@
)
(get_local $3)
)
- (func $___stdio_close (; 31 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 31 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9430,7 +9430,7 @@
)
(get_local $0)
)
- (func $___syscall_ret (; 32 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9449,7 +9449,7 @@
(get_local $0)
)
)
- (func $dynCall_iiii (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 33 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9463,7 +9463,7 @@
)
)
)
- (func $stackAlloc (; 34 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9485,7 +9485,7 @@
)
(get_local $1)
)
- (func $___errno_location (; 35 ;) (result i32)
+ (func $___errno_location (; 35 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 8)
@@ -9496,7 +9496,7 @@
(i32.const 60)
)
)
- (func $setThrew (; 36 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -9511,7 +9511,7 @@
)
)
)
- (func $dynCall_ii (; 37 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 37 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9520,14 +9520,14 @@
)
)
)
- (func $_cleanup_418 (; 38 ;) (param $0 i32)
+ (func $_cleanup_418 (; 38 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $establishStackSpace (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -9535,7 +9535,7 @@
(get_local $1)
)
)
- (func $dynCall_vi (; 40 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9547,32 +9547,32 @@
)
)
)
- (func $b1 (; 41 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $abort
(i32.const 1)
)
(i32.const 0)
)
- (func $stackRestore (; 42 ;) (param $0 i32)
+ (func $stackRestore (; 42 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $setTempRet0 (; 43 ;) (param $0 i32)
+ (func $setTempRet0 (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $b0 (; 44 ;) (param $0 i32) (result i32)
+ (func $b0 (; 44 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $abort
(i32.const 0)
)
(i32.const 0)
)
- (func $getTempRet0 (; 45 ;) (result i32)
+ (func $getTempRet0 (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 46 ;) (result i32)
+ (func $_main (; 46 ;) (; has Stack IR ;) (result i32)
(drop
(call $_puts
(i32.const 672)
@@ -9580,10 +9580,10 @@
)
(i32.const 0)
)
- (func $stackSave (; 47 ;) (result i32)
+ (func $stackSave (; 47 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $b2 (; 48 ;) (param $0 i32)
+ (func $b2 (; 48 ;) (; has Stack IR ;) (param $0 i32)
(call $abort
(i32.const 2)
)
diff --git a/test/emcc_O2_hello_world.fromasm.clamp b/test/emcc_O2_hello_world.fromasm.clamp
index cd097028a..0566193d0 100644
--- a/test/emcc_O2_hello_world.fromasm.clamp
+++ b/test/emcc_O2_hello_world.fromasm.clamp
@@ -51,7 +51,7 @@
(export "dynCall_ii" (func $dynCall_ii))
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
- (func $_malloc (; 15 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 15 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5830,7 +5830,7 @@
)
(i32.const 0)
)
- (func $_free (; 16 ;) (param $0 i32)
+ (func $_free (; 16 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7651,7 +7651,7 @@
(i32.const -1)
)
)
- (func $___stdio_write (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8025,7 +8025,7 @@
)
(get_local $15)
)
- (func $___fwritex (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8237,7 +8237,7 @@
)
(get_local $4)
)
- (func $_fflush (; 19 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -8344,7 +8344,7 @@
)
(get_local $1)
)
- (func $_strlen (; 20 ;) (param $0 i32) (result i32)
+ (func $_strlen (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8488,7 +8488,7 @@
(get_local $3)
)
)
- (func $___overflow (; 21 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $___overflow (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8642,7 +8642,7 @@
)
(get_local $4)
)
- (func $___fflush_unlocked (; 22 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 22 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8765,7 +8765,7 @@
)
)
)
- (func $_memcpy (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8912,10 +8912,10 @@
)
(get_local $3)
)
- (func $runPostSets (; 24 ;)
+ (func $runPostSets (; 24 ;) (; has Stack IR ;)
(nop)
)
- (func $_memset (; 25 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 25 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9053,7 +9053,7 @@
(get_local $2)
)
)
- (func $_puts (; 26 ;) (param $0 i32) (result i32)
+ (func $_puts (; 26 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -9145,7 +9145,7 @@
(i32.const 31)
)
)
- (func $___stdio_seek (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9214,7 +9214,7 @@
)
(get_local $0)
)
- (func $___towrite (; 28 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 28 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9292,7 +9292,7 @@
)
)
)
- (func $_fwrite (; 29 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_fwrite (; 29 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9331,7 +9331,7 @@
)
(get_local $2)
)
- (func $___stdout_write (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 30 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9400,7 +9400,7 @@
)
(get_local $3)
)
- (func $___stdio_close (; 31 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 31 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9430,7 +9430,7 @@
)
(get_local $0)
)
- (func $___syscall_ret (; 32 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9449,7 +9449,7 @@
(get_local $0)
)
)
- (func $dynCall_iiii (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 33 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9463,7 +9463,7 @@
)
)
)
- (func $stackAlloc (; 34 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9485,7 +9485,7 @@
)
(get_local $1)
)
- (func $___errno_location (; 35 ;) (result i32)
+ (func $___errno_location (; 35 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 8)
@@ -9496,7 +9496,7 @@
(i32.const 60)
)
)
- (func $setThrew (; 36 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -9511,7 +9511,7 @@
)
)
)
- (func $dynCall_ii (; 37 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 37 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9520,14 +9520,14 @@
)
)
)
- (func $_cleanup_418 (; 38 ;) (param $0 i32)
+ (func $_cleanup_418 (; 38 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $establishStackSpace (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -9535,7 +9535,7 @@
(get_local $1)
)
)
- (func $dynCall_vi (; 40 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9547,32 +9547,32 @@
)
)
)
- (func $b1 (; 41 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $abort
(i32.const 1)
)
(i32.const 0)
)
- (func $stackRestore (; 42 ;) (param $0 i32)
+ (func $stackRestore (; 42 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $setTempRet0 (; 43 ;) (param $0 i32)
+ (func $setTempRet0 (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $b0 (; 44 ;) (param $0 i32) (result i32)
+ (func $b0 (; 44 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $abort
(i32.const 0)
)
(i32.const 0)
)
- (func $getTempRet0 (; 45 ;) (result i32)
+ (func $getTempRet0 (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 46 ;) (result i32)
+ (func $_main (; 46 ;) (; has Stack IR ;) (result i32)
(drop
(call $_puts
(i32.const 672)
@@ -9580,10 +9580,10 @@
)
(i32.const 0)
)
- (func $stackSave (; 47 ;) (result i32)
+ (func $stackSave (; 47 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $b2 (; 48 ;) (param $0 i32)
+ (func $b2 (; 48 ;) (; has Stack IR ;) (param $0 i32)
(call $abort
(i32.const 2)
)
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise
index 1e7e99197..d34cf8655 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise
+++ b/test/emcc_O2_hello_world.fromasm.imprecise
@@ -50,7 +50,7 @@
(export "dynCall_ii" (func $dynCall_ii))
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
- (func $_malloc (; 15 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 15 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5829,7 +5829,7 @@
)
(i32.const 0)
)
- (func $_free (; 16 ;) (param $0 i32)
+ (func $_free (; 16 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7650,7 +7650,7 @@
(i32.const -1)
)
)
- (func $___stdio_write (; 17 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8024,7 +8024,7 @@
)
(get_local $15)
)
- (func $___fwritex (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8236,7 +8236,7 @@
)
(get_local $4)
)
- (func $_fflush (; 19 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -8338,7 +8338,7 @@
)
(get_local $1)
)
- (func $_strlen (; 20 ;) (param $0 i32) (result i32)
+ (func $_strlen (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8482,7 +8482,7 @@
(get_local $3)
)
)
- (func $___overflow (; 21 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $___overflow (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8636,7 +8636,7 @@
)
(get_local $4)
)
- (func $___fflush_unlocked (; 22 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 22 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8759,7 +8759,7 @@
)
)
)
- (func $_memcpy (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8906,10 +8906,10 @@
)
(get_local $3)
)
- (func $runPostSets (; 24 ;)
+ (func $runPostSets (; 24 ;) (; has Stack IR ;)
(nop)
)
- (func $_memset (; 25 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 25 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9047,7 +9047,7 @@
(get_local $2)
)
)
- (func $_puts (; 26 ;) (param $0 i32) (result i32)
+ (func $_puts (; 26 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -9139,7 +9139,7 @@
(i32.const 31)
)
)
- (func $___stdio_seek (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9208,7 +9208,7 @@
)
(get_local $0)
)
- (func $___towrite (; 28 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 28 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9286,7 +9286,7 @@
)
)
)
- (func $_fwrite (; 29 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_fwrite (; 29 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9314,7 +9314,7 @@
)
(get_local $2)
)
- (func $___stdout_write (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 30 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9383,7 +9383,7 @@
)
(get_local $3)
)
- (func $___stdio_close (; 31 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 31 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9413,7 +9413,7 @@
)
(get_local $0)
)
- (func $___syscall_ret (; 32 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9432,7 +9432,7 @@
(get_local $0)
)
)
- (func $dynCall_iiii (; 33 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 33 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9446,7 +9446,7 @@
)
)
)
- (func $stackAlloc (; 34 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -9468,7 +9468,7 @@
)
(get_local $1)
)
- (func $___errno_location (; 35 ;) (result i32)
+ (func $___errno_location (; 35 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 8)
@@ -9479,7 +9479,7 @@
(i32.const 60)
)
)
- (func $setThrew (; 36 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -9494,7 +9494,7 @@
)
)
)
- (func $dynCall_ii (; 37 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 37 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9503,10 +9503,10 @@
)
)
)
- (func $_cleanup_418 (; 38 ;) (param $0 i32)
+ (func $_cleanup_418 (; 38 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $establishStackSpace (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -9514,7 +9514,7 @@
(get_local $1)
)
)
- (func $dynCall_vi (; 40 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9526,32 +9526,32 @@
)
)
)
- (func $b1 (; 41 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $abort
(i32.const 1)
)
(i32.const 0)
)
- (func $stackRestore (; 42 ;) (param $0 i32)
+ (func $stackRestore (; 42 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $setTempRet0 (; 43 ;) (param $0 i32)
+ (func $setTempRet0 (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $b0 (; 44 ;) (param $0 i32) (result i32)
+ (func $b0 (; 44 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $abort
(i32.const 0)
)
(i32.const 0)
)
- (func $getTempRet0 (; 45 ;) (result i32)
+ (func $getTempRet0 (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 46 ;) (result i32)
+ (func $_main (; 46 ;) (; has Stack IR ;) (result i32)
(drop
(call $_puts
(i32.const 672)
@@ -9559,10 +9559,10 @@
)
(i32.const 0)
)
- (func $stackSave (; 47 ;) (result i32)
+ (func $stackSave (; 47 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $b2 (; 48 ;) (param $0 i32)
+ (func $b2 (; 48 ;) (; has Stack IR ;) (param $0 i32)
(call $abort
(i32.const 2)
)
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index 5f9343488..6811213dc 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -63,7 +63,7 @@
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
(export "___udivmoddi4" (func $___udivmoddi4))
- (func $stackAlloc (; 19 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -92,15 +92,15 @@
)
(get_local $1)
)
- (func $stackSave (; 20 ;) (result i32)
+ (func $stackSave (; 20 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $stackRestore (; 21 ;) (param $0 i32)
+ (func $stackRestore (; 21 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $establishStackSpace (; 22 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -108,7 +108,7 @@
(get_local $1)
)
)
- (func $setThrew (; 23 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -123,15 +123,15 @@
)
)
)
- (func $setTempRet0 (; 24 ;) (param $0 i32)
+ (func $setTempRet0 (; 24 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $getTempRet0 (; 25 ;) (result i32)
+ (func $getTempRet0 (; 25 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 26 ;) (result i32)
+ (func $_main (; 26 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(set_local $0
(get_global $STACKTOP)
@@ -160,7 +160,7 @@
)
(i32.const 0)
)
- (func $_frexp (; 27 ;) (param $0 f64) (param $1 i32) (result f64)
+ (func $_frexp (; 27 ;) (; has Stack IR ;) (param $0 f64) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -265,7 +265,7 @@
)
(get_local $0)
)
- (func $_strerror (; 28 ;) (param $0 i32) (result i32)
+ (func $_strerror (; 28 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $__rjto$1
@@ -343,7 +343,7 @@
)
(get_local $0)
)
- (func $___errno_location (; 29 ;) (result i32)
+ (func $___errno_location (; 29 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 16)
@@ -354,7 +354,7 @@
(i32.const 60)
)
)
- (func $___stdio_close (; 30 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -391,7 +391,7 @@
)
(get_local $0)
)
- (func $___stdout_write (; 31 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 31 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -471,7 +471,7 @@
)
(get_local $0)
)
- (func $___stdio_seek (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 32 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -547,7 +547,7 @@
)
(get_local $0)
)
- (func $_fflush (; 33 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -642,7 +642,7 @@
)
(get_local $0)
)
- (func $_printf (; 34 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_printf (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(set_local $2
(get_global $STACKTOP)
@@ -678,7 +678,7 @@
)
(get_local $0)
)
- (func $___stdio_write (; 35 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1023,7 +1023,7 @@
)
(get_local $2)
)
- (func $_vfprintf (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_vfprintf (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1300,7 +1300,7 @@
)
(get_local $0)
)
- (func $___fwritex (; 37 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 37 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1486,7 +1486,7 @@
)
(get_local $3)
)
- (func $___towrite (; 38 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 38 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $1
@@ -1564,7 +1564,7 @@
)
)
)
- (func $_wcrtomb (; 39 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_wcrtomb (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $do-once (result i32)
(if (result i32)
(get_local $0)
@@ -1738,7 +1738,7 @@
)
)
)
- (func $_wctomb (; 40 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_wctomb (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $0)
(call $_wcrtomb
@@ -1749,7 +1749,7 @@
(i32.const 0)
)
)
- (func $_memchr (; 41 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1980,7 +1980,7 @@
(get_local $0)
)
)
- (func $___syscall_ret (; 42 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 42 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -1999,7 +1999,7 @@
(get_local $0)
)
)
- (func $___fflush_unlocked (; 43 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 43 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -2121,14 +2121,14 @@
)
)
)
- (func $_cleanup (; 44 ;) (param $0 i32)
+ (func $_cleanup (; 44 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $i32s-div (; 45 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32s-div (; 45 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(if (result i32)
@@ -2151,7 +2151,7 @@
(i32.const 0)
)
)
- (func $i32u-rem (; 46 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32u-rem (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.rem_u
@@ -2161,7 +2161,7 @@
(i32.const 0)
)
)
- (func $i32u-div (; 47 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32u-div (; 47 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.div_u
@@ -2171,7 +2171,7 @@
(i32.const 0)
)
)
- (func $_printf_core (; 48 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_printf_core (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -6991,7 +6991,7 @@
)
(get_local $17)
)
- (func $_pop_arg_336 (; 49 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $_pop_arg_336 (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 f64)
(local $5 i32)
@@ -7391,7 +7391,7 @@
)
)
)
- (func $_fmt_u (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_fmt_u (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(if
@@ -7513,7 +7513,7 @@
)
(get_local $2)
)
- (func $_pad (; 51 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
+ (func $_pad (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -7661,7 +7661,7 @@
(get_local $7)
)
)
- (func $_malloc (; 52 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 52 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -13094,7 +13094,7 @@
(i32.const 8)
)
)
- (func $_free (; 53 ;) (param $0 i32)
+ (func $_free (; 53 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -14877,10 +14877,10 @@
(i32.const -1)
)
)
- (func $runPostSets (; 54 ;)
+ (func $runPostSets (; 54 ;) (; has Stack IR ;)
(nop)
)
- (func $_i64Subtract (; 55 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Subtract (; 55 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(set_global $tempRet0
(i32.sub
(i32.sub
@@ -14898,7 +14898,7 @@
(get_local $2)
)
)
- (func $_i64Add (; 56 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Add (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_global $tempRet0
(i32.add
@@ -14919,7 +14919,7 @@
)
(get_local $4)
)
- (func $_memset (; 57 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -15057,7 +15057,7 @@
(get_local $2)
)
)
- (func $_bitshift64Lshr (; 58 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Lshr (; 58 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15107,7 +15107,7 @@
)
)
)
- (func $_bitshift64Shl (; 59 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Shl (; 59 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15163,7 +15163,7 @@
)
(i32.const 0)
)
- (func $_memcpy (; 60 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -15310,7 +15310,7 @@
)
(get_local $3)
)
- (func $___udivdi3 (; 61 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___udivdi3 (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call $___udivmoddi4
(get_local $0)
(get_local $1)
@@ -15319,7 +15319,7 @@
(i32.const 0)
)
)
- (func $___uremdi3 (; 62 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___uremdi3 (; 62 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(get_global $STACKTOP)
@@ -15351,7 +15351,7 @@
(get_local $4)
)
)
- (func $___udivmoddi4 (; 63 ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
+ (func $___udivmoddi4 (; 63 ;) (; has Stack IR ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
(local $x64 i64)
(local $y64 i64)
(set_local $x64
@@ -15408,7 +15408,7 @@
(get_local $x64)
)
)
- (func $dynCall_ii (; 64 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 64 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -15417,7 +15417,7 @@
)
)
)
- (func $dynCall_iiii (; 65 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 65 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -15431,7 +15431,7 @@
)
)
)
- (func $dynCall_vi (; 66 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 66 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -15443,19 +15443,19 @@
)
)
)
- (func $b0 (; 67 ;) (param $0 i32) (result i32)
+ (func $b0 (; 67 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $nullFunc_ii
(i32.const 0)
)
(i32.const 0)
)
- (func $b1 (; 68 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 68 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $nullFunc_iiii
(i32.const 1)
)
(i32.const 0)
)
- (func $b2 (; 69 ;) (param $0 i32)
+ (func $b2 (; 69 ;) (; has Stack IR ;) (param $0 i32)
(call $nullFunc_vi
(i32.const 2)
)
diff --git a/test/emcc_hello_world.fromasm.clamp b/test/emcc_hello_world.fromasm.clamp
index 9ce70c0b5..ea687d264 100644
--- a/test/emcc_hello_world.fromasm.clamp
+++ b/test/emcc_hello_world.fromasm.clamp
@@ -61,7 +61,7 @@
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
(export "___udivmoddi4" (func $___udivmoddi4))
- (func $stackAlloc (; 18 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -90,15 +90,15 @@
)
(get_local $1)
)
- (func $stackSave (; 19 ;) (result i32)
+ (func $stackSave (; 19 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $stackRestore (; 20 ;) (param $0 i32)
+ (func $stackRestore (; 20 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $establishStackSpace (; 21 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -106,7 +106,7 @@
(get_local $1)
)
)
- (func $setThrew (; 22 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -121,15 +121,15 @@
)
)
)
- (func $setTempRet0 (; 23 ;) (param $0 i32)
+ (func $setTempRet0 (; 23 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $getTempRet0 (; 24 ;) (result i32)
+ (func $getTempRet0 (; 24 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 25 ;) (result i32)
+ (func $_main (; 25 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(set_local $0
(get_global $STACKTOP)
@@ -158,7 +158,7 @@
)
(i32.const 0)
)
- (func $_frexp (; 26 ;) (param $0 f64) (param $1 i32) (result f64)
+ (func $_frexp (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -263,7 +263,7 @@
)
(get_local $0)
)
- (func $_strerror (; 27 ;) (param $0 i32) (result i32)
+ (func $_strerror (; 27 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $__rjto$1
@@ -341,7 +341,7 @@
)
(get_local $0)
)
- (func $___errno_location (; 28 ;) (result i32)
+ (func $___errno_location (; 28 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 16)
@@ -352,7 +352,7 @@
(i32.const 60)
)
)
- (func $___stdio_close (; 29 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -389,7 +389,7 @@
)
(get_local $0)
)
- (func $___stdout_write (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 30 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -469,7 +469,7 @@
)
(get_local $0)
)
- (func $___stdio_seek (; 31 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 31 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -545,7 +545,7 @@
)
(get_local $0)
)
- (func $_fflush (; 32 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -640,7 +640,7 @@
)
(get_local $0)
)
- (func $_printf (; 33 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_printf (; 33 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(set_local $2
(get_global $STACKTOP)
@@ -676,7 +676,7 @@
)
(get_local $0)
)
- (func $___stdio_write (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1021,7 +1021,7 @@
)
(get_local $2)
)
- (func $_vfprintf (; 35 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_vfprintf (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1298,7 +1298,7 @@
)
(get_local $0)
)
- (func $___fwritex (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1484,7 +1484,7 @@
)
(get_local $3)
)
- (func $___towrite (; 37 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 37 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $1
@@ -1562,7 +1562,7 @@
)
)
)
- (func $_wcrtomb (; 38 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_wcrtomb (; 38 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $do-once (result i32)
(if (result i32)
(get_local $0)
@@ -1736,7 +1736,7 @@
)
)
)
- (func $_wctomb (; 39 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_wctomb (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $0)
(call $_wcrtomb
@@ -1747,7 +1747,7 @@
(i32.const 0)
)
)
- (func $_memchr (; 40 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1978,7 +1978,7 @@
(get_local $0)
)
)
- (func $___syscall_ret (; 41 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 41 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -1997,7 +1997,7 @@
(get_local $0)
)
)
- (func $___fflush_unlocked (; 42 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 42 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -2119,14 +2119,14 @@
)
)
)
- (func $_cleanup (; 43 ;) (param $0 i32)
+ (func $_cleanup (; 43 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $f64-to-int (; 44 ;) (param $0 f64) (result i32)
+ (func $f64-to-int (; 44 ;) (; has Stack IR ;) (param $0 f64) (result i32)
(if (result i32)
(f64.ne
(get_local $0)
@@ -2152,7 +2152,7 @@
)
)
)
- (func $f64-to-uint (; 45 ;) (param $0 f64) (result i32)
+ (func $f64-to-uint (; 45 ;) (; has Stack IR ;) (param $0 f64) (result i32)
(if (result i32)
(f64.ne
(get_local $0)
@@ -2178,7 +2178,7 @@
)
)
)
- (func $i32s-div (; 46 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32s-div (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(if (result i32)
@@ -2201,7 +2201,7 @@
(i32.const 0)
)
)
- (func $i32u-rem (; 47 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32u-rem (; 47 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.rem_u
@@ -2211,7 +2211,7 @@
(i32.const 0)
)
)
- (func $i32u-div (; 48 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $i32u-div (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $1)
(i32.div_u
@@ -2221,7 +2221,7 @@
(i32.const 0)
)
)
- (func $_printf_core (; 49 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_printf_core (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -7041,7 +7041,7 @@
)
(get_local $17)
)
- (func $_pop_arg_336 (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $_pop_arg_336 (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 f64)
(local $5 i32)
@@ -7441,7 +7441,7 @@
)
)
)
- (func $_fmt_u (; 51 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_fmt_u (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(if
@@ -7563,7 +7563,7 @@
)
(get_local $2)
)
- (func $_pad (; 52 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
+ (func $_pad (; 52 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -7711,7 +7711,7 @@
(get_local $7)
)
)
- (func $_malloc (; 53 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 53 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -13144,7 +13144,7 @@
(i32.const 8)
)
)
- (func $_free (; 54 ;) (param $0 i32)
+ (func $_free (; 54 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -14927,10 +14927,10 @@
(i32.const -1)
)
)
- (func $runPostSets (; 55 ;)
+ (func $runPostSets (; 55 ;) (; has Stack IR ;)
(nop)
)
- (func $_i64Subtract (; 56 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Subtract (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(set_global $tempRet0
(i32.sub
(i32.sub
@@ -14948,7 +14948,7 @@
(get_local $2)
)
)
- (func $_i64Add (; 57 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Add (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_global $tempRet0
(i32.add
@@ -14969,7 +14969,7 @@
)
(get_local $4)
)
- (func $_memset (; 58 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 58 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -15107,7 +15107,7 @@
(get_local $2)
)
)
- (func $_bitshift64Lshr (; 59 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Lshr (; 59 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15157,7 +15157,7 @@
)
)
)
- (func $_bitshift64Shl (; 60 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Shl (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15213,7 +15213,7 @@
)
(i32.const 0)
)
- (func $_memcpy (; 61 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -15360,7 +15360,7 @@
)
(get_local $3)
)
- (func $___udivdi3 (; 62 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___udivdi3 (; 62 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call $___udivmoddi4
(get_local $0)
(get_local $1)
@@ -15369,7 +15369,7 @@
(i32.const 0)
)
)
- (func $___uremdi3 (; 63 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___uremdi3 (; 63 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(get_global $STACKTOP)
@@ -15401,7 +15401,7 @@
(get_local $4)
)
)
- (func $___udivmoddi4 (; 64 ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
+ (func $___udivmoddi4 (; 64 ;) (; has Stack IR ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
(local $x64 i64)
(local $y64 i64)
(set_local $x64
@@ -15458,7 +15458,7 @@
(get_local $x64)
)
)
- (func $dynCall_ii (; 65 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 65 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -15467,7 +15467,7 @@
)
)
)
- (func $dynCall_iiii (; 66 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 66 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -15481,7 +15481,7 @@
)
)
)
- (func $dynCall_vi (; 67 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 67 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -15493,19 +15493,19 @@
)
)
)
- (func $b0 (; 68 ;) (param $0 i32) (result i32)
+ (func $b0 (; 68 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $nullFunc_ii
(i32.const 0)
)
(i32.const 0)
)
- (func $b1 (; 69 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 69 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $nullFunc_iiii
(i32.const 1)
)
(i32.const 0)
)
- (func $b2 (; 70 ;) (param $0 i32)
+ (func $b2 (; 70 ;) (; has Stack IR ;) (param $0 i32)
(call $nullFunc_vi
(i32.const 2)
)
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index f76c07317..25ca0c3da 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -60,7 +60,7 @@
(export "dynCall_iiii" (func $dynCall_iiii))
(export "dynCall_vi" (func $dynCall_vi))
(export "___udivmoddi4" (func $___udivmoddi4))
- (func $stackAlloc (; 18 ;) (param $0 i32) (result i32)
+ (func $stackAlloc (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -89,15 +89,15 @@
)
(get_local $1)
)
- (func $stackSave (; 19 ;) (result i32)
+ (func $stackSave (; 19 ;) (; has Stack IR ;) (result i32)
(get_global $STACKTOP)
)
- (func $stackRestore (; 20 ;) (param $0 i32)
+ (func $stackRestore (; 20 ;) (; has Stack IR ;) (param $0 i32)
(set_global $STACKTOP
(get_local $0)
)
)
- (func $establishStackSpace (; 21 ;) (param $0 i32) (param $1 i32)
+ (func $establishStackSpace (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $STACKTOP
(get_local $0)
)
@@ -105,7 +105,7 @@
(get_local $1)
)
)
- (func $setThrew (; 22 ;) (param $0 i32) (param $1 i32)
+ (func $setThrew (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $__THREW__)
@@ -120,15 +120,15 @@
)
)
)
- (func $setTempRet0 (; 23 ;) (param $0 i32)
+ (func $setTempRet0 (; 23 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
)
- (func $getTempRet0 (; 24 ;) (result i32)
+ (func $getTempRet0 (; 24 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $_main (; 25 ;) (result i32)
+ (func $_main (; 25 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(set_local $0
(get_global $STACKTOP)
@@ -157,7 +157,7 @@
)
(i32.const 0)
)
- (func $_frexp (; 26 ;) (param $0 f64) (param $1 i32) (result f64)
+ (func $_frexp (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -262,7 +262,7 @@
)
(get_local $0)
)
- (func $_strerror (; 27 ;) (param $0 i32) (result i32)
+ (func $_strerror (; 27 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $__rjto$1
@@ -340,7 +340,7 @@
)
(get_local $0)
)
- (func $___errno_location (; 28 ;) (result i32)
+ (func $___errno_location (; 28 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 16)
@@ -351,7 +351,7 @@
(i32.const 60)
)
)
- (func $___stdio_close (; 29 ;) (param $0 i32) (result i32)
+ (func $___stdio_close (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $STACKTOP)
@@ -388,7 +388,7 @@
)
(get_local $0)
)
- (func $___stdout_write (; 30 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 30 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -468,7 +468,7 @@
)
(get_local $0)
)
- (func $___stdio_seek (; 31 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_seek (; 31 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -544,7 +544,7 @@
)
(get_local $0)
)
- (func $_fflush (; 32 ;) (param $0 i32) (result i32)
+ (func $_fflush (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(block $do-once
@@ -634,7 +634,7 @@
)
(get_local $0)
)
- (func $_printf (; 33 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_printf (; 33 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(set_local $2
(get_global $STACKTOP)
@@ -670,7 +670,7 @@
)
(get_local $0)
)
- (func $___stdio_write (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1015,7 +1015,7 @@
)
(get_local $2)
)
- (func $_vfprintf (; 35 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_vfprintf (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1287,7 +1287,7 @@
)
(get_local $0)
)
- (func $___fwritex (; 36 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___fwritex (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1473,7 +1473,7 @@
)
(get_local $3)
)
- (func $___towrite (; 37 ;) (param $0 i32) (result i32)
+ (func $___towrite (; 37 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $1
@@ -1551,7 +1551,7 @@
)
)
)
- (func $_wcrtomb (; 38 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_wcrtomb (; 38 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $do-once (result i32)
(if (result i32)
(get_local $0)
@@ -1725,7 +1725,7 @@
)
)
)
- (func $_wctomb (; 39 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $_wctomb (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if (result i32)
(get_local $0)
(call $_wcrtomb
@@ -1736,7 +1736,7 @@
(i32.const 0)
)
)
- (func $_memchr (; 40 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -1967,7 +1967,7 @@
(get_local $0)
)
)
- (func $___syscall_ret (; 41 ;) (param $0 i32) (result i32)
+ (func $___syscall_ret (; 41 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -1986,7 +1986,7 @@
(get_local $0)
)
)
- (func $___fflush_unlocked (; 42 ;) (param $0 i32) (result i32)
+ (func $___fflush_unlocked (; 42 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -2108,10 +2108,10 @@
)
)
)
- (func $_cleanup (; 43 ;) (param $0 i32)
+ (func $_cleanup (; 43 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $_printf_core (; 44 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_printf_core (; 44 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -6906,7 +6906,7 @@
)
(get_local $17)
)
- (func $_pop_arg_336 (; 45 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $_pop_arg_336 (; 45 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 f64)
(local $5 i32)
@@ -7306,7 +7306,7 @@
)
)
)
- (func $_fmt_u (; 46 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_fmt_u (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(if
@@ -7428,7 +7428,7 @@
)
(get_local $2)
)
- (func $_pad (; 47 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
+ (func $_pad (; 47 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
@@ -7576,7 +7576,7 @@
(get_local $7)
)
)
- (func $_malloc (; 48 ;) (param $0 i32) (result i32)
+ (func $_malloc (; 48 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -13009,7 +13009,7 @@
(i32.const 8)
)
)
- (func $_free (; 49 ;) (param $0 i32)
+ (func $_free (; 49 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -14791,10 +14791,10 @@
(i32.const -1)
)
)
- (func $runPostSets (; 50 ;)
+ (func $runPostSets (; 50 ;) (; has Stack IR ;)
(nop)
)
- (func $_i64Subtract (; 51 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Subtract (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(set_global $tempRet0
(i32.sub
(i32.sub
@@ -14812,7 +14812,7 @@
(get_local $2)
)
)
- (func $_i64Add (; 52 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $_i64Add (; 52 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_global $tempRet0
(i32.add
@@ -14833,7 +14833,7 @@
)
(get_local $4)
)
- (func $_memset (; 53 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memset (; 53 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -14971,7 +14971,7 @@
(get_local $2)
)
)
- (func $_bitshift64Lshr (; 54 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Lshr (; 54 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15021,7 +15021,7 @@
)
)
)
- (func $_bitshift64Shl (; 55 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_bitshift64Shl (; 55 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(if
(i32.lt_s
(get_local $2)
@@ -15077,7 +15077,7 @@
)
(i32.const 0)
)
- (func $_memcpy (; 56 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memcpy (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -15224,7 +15224,7 @@
)
(get_local $3)
)
- (func $___udivdi3 (; 57 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___udivdi3 (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call $___udivmoddi4
(get_local $0)
(get_local $1)
@@ -15233,7 +15233,7 @@
(i32.const 0)
)
)
- (func $___uremdi3 (; 58 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $___uremdi3 (; 58 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(get_global $STACKTOP)
@@ -15265,7 +15265,7 @@
(get_local $4)
)
)
- (func $___udivmoddi4 (; 59 ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
+ (func $___udivmoddi4 (; 59 ;) (; has Stack IR ;) (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (param $r i32) (result i32)
(local $x64 i64)
(local $y64 i64)
(set_local $x64
@@ -15322,7 +15322,7 @@
(get_local $x64)
)
)
- (func $dynCall_ii (; 60 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $dynCall_ii (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -15331,7 +15331,7 @@
)
)
)
- (func $dynCall_iiii (; 61 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $dynCall_iiii (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -15345,7 +15345,7 @@
)
)
)
- (func $dynCall_vi (; 62 ;) (param $0 i32) (param $1 i32)
+ (func $dynCall_vi (; 62 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -15357,19 +15357,19 @@
)
)
)
- (func $b0 (; 63 ;) (param $0 i32) (result i32)
+ (func $b0 (; 63 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $nullFunc_ii
(i32.const 0)
)
(i32.const 0)
)
- (func $b1 (; 64 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $b1 (; 64 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $nullFunc_iiii
(i32.const 1)
)
(i32.const 0)
)
- (func $b2 (; 65 ;) (param $0 i32)
+ (func $b2 (; 65 ;) (; has Stack IR ;) (param $0 i32)
(call $nullFunc_vi
(i32.const 2)
)
diff --git a/test/example/relooper-fuzz.txt b/test/example/relooper-fuzz.txt
index aeee64325..bde48af8c 100644
--- a/test/example/relooper-fuzz.txt
+++ b/test/example/relooper-fuzz.txt
@@ -299,7 +299,7 @@
(memory $0 1 1)
(export "mem" (memory $0))
(start $main)
- (func $check (; 1 ;) (type $i) (result i32)
+ (func $check (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(if
(i32.eq
(i32.load
@@ -334,7 +334,7 @@
)
)
)
- (func $main (; 2 ;) (type $v)
+ (func $main (; 2 ;) (; has Stack IR ;) (type $v)
(local $0 i32)
(local $1 i32)
(i32.store
diff --git a/test/example/relooper-fuzz1.txt b/test/example/relooper-fuzz1.txt
index 5da2f5ff3..af3140f9c 100644
--- a/test/example/relooper-fuzz1.txt
+++ b/test/example/relooper-fuzz1.txt
@@ -275,7 +275,7 @@
(memory $0 1 1)
(export "mem" (memory $0))
(start $main)
- (func $check (; 1 ;) (type $i) (result i32)
+ (func $check (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(if
(i32.eq
(i32.load
@@ -310,7 +310,7 @@
)
)
)
- (func $main (; 2 ;) (type $v)
+ (func $main (; 2 ;) (; has Stack IR ;) (type $v)
(local $0 i32)
(i32.store
(i32.const 8)
diff --git a/test/hello_world.fromasm b/test/hello_world.fromasm
index a98f6895d..16f132114 100644
--- a/test/hello_world.fromasm
+++ b/test/hello_world.fromasm
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "hello_world.asm.js")
(export "add" (func $add))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
diff --git a/test/hello_world.fromasm.clamp b/test/hello_world.fromasm.clamp
index a98f6895d..16f132114 100644
--- a/test/hello_world.fromasm.clamp
+++ b/test/hello_world.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "hello_world.asm.js")
(export "add" (func $add))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
diff --git a/test/hello_world.fromasm.imprecise b/test/hello_world.fromasm.imprecise
index 3655a5039..1732728a5 100644
--- a/test/hello_world.fromasm.imprecise
+++ b/test/hello_world.fromasm.imprecise
@@ -1,6 +1,6 @@
(module
(export "add" (func $add))
- (func $add (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $add (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
diff --git a/test/i64-setTempRet0.fromasm b/test/i64-setTempRet0.fromasm
index ecb43a49c..bb834c144 100644
--- a/test/i64-setTempRet0.fromasm
+++ b/test/i64-setTempRet0.fromasm
@@ -7,7 +7,7 @@
(data (get_global $memoryBase) "i64-setTempRet0.asm.js")
(export "illegalResult" (func $legalstub$illegalResult))
(export "imports" (func $imports))
- (func $imports (; 1 ;) (result i32)
+ (func $imports (; 1 ;) (; has Stack IR ;) (result i32)
(i32.wrap/i64
(i64.or
(i64.extend_u/i32
@@ -22,7 +22,7 @@
)
)
)
- (func $legalstub$illegalResult (; 2 ;) (result i32)
+ (func $legalstub$illegalResult (; 2 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
diff --git a/test/i64-setTempRet0.fromasm.clamp b/test/i64-setTempRet0.fromasm.clamp
index ecb43a49c..bb834c144 100644
--- a/test/i64-setTempRet0.fromasm.clamp
+++ b/test/i64-setTempRet0.fromasm.clamp
@@ -7,7 +7,7 @@
(data (get_global $memoryBase) "i64-setTempRet0.asm.js")
(export "illegalResult" (func $legalstub$illegalResult))
(export "imports" (func $imports))
- (func $imports (; 1 ;) (result i32)
+ (func $imports (; 1 ;) (; has Stack IR ;) (result i32)
(i32.wrap/i64
(i64.or
(i64.extend_u/i32
@@ -22,7 +22,7 @@
)
)
)
- (func $legalstub$illegalResult (; 2 ;) (result i32)
+ (func $legalstub$illegalResult (; 2 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
diff --git a/test/i64-setTempRet0.fromasm.imprecise b/test/i64-setTempRet0.fromasm.imprecise
index c1ead5c79..4b22d94c8 100644
--- a/test/i64-setTempRet0.fromasm.imprecise
+++ b/test/i64-setTempRet0.fromasm.imprecise
@@ -4,7 +4,7 @@
(global $tempRet0 (mut i32) (i32.const 0))
(export "illegalResult" (func $legalstub$illegalResult))
(export "imports" (func $imports))
- (func $imports (; 1 ;) (result i32)
+ (func $imports (; 1 ;) (; has Stack IR ;) (result i32)
(i32.wrap/i64
(i64.or
(i64.extend_u/i32
@@ -19,7 +19,7 @@
)
)
)
- (func $legalstub$illegalResult (; 2 ;) (result i32)
+ (func $legalstub$illegalResult (; 2 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
diff --git a/test/importedSignCast.fromasm b/test/importedSignCast.fromasm
index bc08b3596..81652875a 100644
--- a/test/importedSignCast.fromasm
+++ b/test/importedSignCast.fromasm
@@ -8,7 +8,7 @@
(elem (get_global $tableBase) $gm)
(data (get_global $memoryBase) "importedSignCast.asm.js")
(export "func" (func $func))
- (func $func (; 1 ;)
+ (func $func (; 1 ;) (; has Stack IR ;)
(drop
(call $gm
(i32.const 0)
diff --git a/test/importedSignCast.fromasm.clamp b/test/importedSignCast.fromasm.clamp
index bc08b3596..81652875a 100644
--- a/test/importedSignCast.fromasm.clamp
+++ b/test/importedSignCast.fromasm.clamp
@@ -8,7 +8,7 @@
(elem (get_global $tableBase) $gm)
(data (get_global $memoryBase) "importedSignCast.asm.js")
(export "func" (func $func))
- (func $func (; 1 ;)
+ (func $func (; 1 ;) (; has Stack IR ;)
(drop
(call $gm
(i32.const 0)
diff --git a/test/importedSignCast.fromasm.imprecise b/test/importedSignCast.fromasm.imprecise
index ecf04c851..d31be8dc4 100644
--- a/test/importedSignCast.fromasm.imprecise
+++ b/test/importedSignCast.fromasm.imprecise
@@ -5,7 +5,7 @@
(import "env" "_emscripten_glIsTexture" (func $gm (param i32) (result i32)))
(elem (get_global $tableBase) $gm)
(export "func" (func $func))
- (func $func (; 1 ;)
+ (func $func (; 1 ;) (; has Stack IR ;)
(drop
(call $gm
(i32.const 0)
diff --git a/test/memorygrowth-minimal.fromasm b/test/memorygrowth-minimal.fromasm
index 5c5b303b3..021d7fca2 100644
--- a/test/memorygrowth-minimal.fromasm
+++ b/test/memorygrowth-minimal.fromasm
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "memorygrowth-minimal.asm.js")
(export "__growWasmMemory" (func $__growWasmMemory))
- (func $__growWasmMemory (; 0 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
diff --git a/test/memorygrowth-minimal.fromasm.clamp b/test/memorygrowth-minimal.fromasm.clamp
index 5c5b303b3..021d7fca2 100644
--- a/test/memorygrowth-minimal.fromasm.clamp
+++ b/test/memorygrowth-minimal.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "memorygrowth-minimal.asm.js")
(export "__growWasmMemory" (func $__growWasmMemory))
- (func $__growWasmMemory (; 0 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
diff --git a/test/memorygrowth-minimal.fromasm.imprecise b/test/memorygrowth-minimal.fromasm.imprecise
index 4f308717e..7a8ef1065 100644
--- a/test/memorygrowth-minimal.fromasm.imprecise
+++ b/test/memorygrowth-minimal.fromasm.imprecise
@@ -1,7 +1,7 @@
(module
(import "env" "memory" (memory $0 256))
(export "__growWasmMemory" (func $__growWasmMemory))
- (func $__growWasmMemory (; 0 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 0 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm
index cf5cf85c2..5afec926b 100644
--- a/test/memorygrowth.fromasm
+++ b/test/memorygrowth.fromasm
@@ -50,12 +50,12 @@
(export "dynCall_ii" (func $kb))
(export "dynCall_iiii" (func $lb))
(export "dynCall_vi" (func $mb))
- (func $__growWasmMemory (; 12 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
)
- (func $eb (; 13 ;) (param $0 i32) (result i32)
+ (func $eb (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5877,7 +5877,7 @@
(i32.const 8)
)
)
- (func $fb (; 14 ;) (param $0 i32)
+ (func $fb (; 14 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7698,7 +7698,7 @@
(i32.const -1)
)
)
- (func $Ra (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ra (; 15 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8072,7 +8072,7 @@
)
(get_local $15)
)
- (func $Wa (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Wa (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8284,7 +8284,7 @@
)
(get_local $4)
)
- (func $Za (; 17 ;) (param $0 i32) (result i32)
+ (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8428,7 +8428,7 @@
(get_local $3)
)
)
- (func $_a (; 18 ;) (param $0 i32) (result i32)
+ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(tee_local $1
@@ -8532,7 +8532,7 @@
)
)
)
- (func $ab (; 19 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ab (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8681,7 +8681,7 @@
)
(get_local $4)
)
- (func $$a (; 20 ;) (param $0 i32) (result i32)
+ (func $$a (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8816,7 +8816,7 @@
)
(get_local $2)
)
- (func $jb (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8963,10 +8963,10 @@
)
(get_local $3)
)
- (func $gb (; 22 ;)
+ (func $gb (; 22 ;) (; has Stack IR ;)
(nop)
)
- (func $hb (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $hb (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9104,7 +9104,7 @@
(get_local $2)
)
)
- (func $db (; 24 ;) (param $0 i32) (result i32)
+ (func $db (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(drop
@@ -9194,7 +9194,7 @@
(i32.const 31)
)
)
- (func $Xa (; 25 ;) (param $0 i32) (result i32)
+ (func $Xa (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9272,7 +9272,7 @@
)
)
)
- (func $bb (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $bb (; 26 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9311,7 +9311,7 @@
)
(get_local $2)
)
- (func $Ua (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ua (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9380,7 +9380,7 @@
)
(get_local $0)
)
- (func $Va (; 28 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Va (; 28 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9450,7 +9450,7 @@
)
(get_local $3)
)
- (func $Oa (; 29 ;) (param $0 i32) (result i32)
+ (func $Oa (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9480,7 +9480,7 @@
)
(get_local $0)
)
- (func $Pa (; 30 ;) (param $0 i32) (result i32)
+ (func $Pa (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9499,7 +9499,7 @@
(get_local $0)
)
)
- (func $Qa (; 31 ;) (result i32)
+ (func $Qa (; 31 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 1160)
@@ -9510,7 +9510,7 @@
(i32.const 1204)
)
)
- (func $lb (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $lb (; 32 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9524,7 +9524,7 @@
)
)
)
- (func $Ea (; 33 ;) (param $0 i32) (result i32)
+ (func $Ea (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9546,13 +9546,13 @@
)
(get_local $1)
)
- (func $ob (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $ob (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $ja
(i32.const 1)
)
(i32.const 0)
)
- (func $Ia (; 35 ;) (param $0 i32) (param $1 i32)
+ (func $Ia (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $v)
@@ -9567,7 +9567,7 @@
)
)
)
- (func $kb (; 36 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $kb (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9576,14 +9576,14 @@
)
)
)
- (func $Sa (; 37 ;) (param $0 i32)
+ (func $Sa (; 37 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $mb (; 38 ;) (param $0 i32) (param $1 i32)
+ (func $mb (; 38 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9595,7 +9595,7 @@
)
)
)
- (func $Ha (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $Ha (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $r
(get_local $0)
)
@@ -9603,13 +9603,13 @@
(get_local $1)
)
)
- (func $nb (; 40 ;) (param $0 i32) (result i32)
+ (func $nb (; 40 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $ja
(i32.const 0)
)
(i32.const 0)
)
- (func $Na (; 41 ;) (result i32)
+ (func $Na (; 41 ;) (; has Stack IR ;) (result i32)
(drop
(call $db
(i32.const 1144)
@@ -9617,28 +9617,28 @@
)
(i32.const 0)
)
- (func $pb (; 42 ;) (param $0 i32)
+ (func $pb (; 42 ;) (; has Stack IR ;) (param $0 i32)
(call $ja
(i32.const 2)
)
)
- (func $La (; 43 ;) (param $0 i32)
+ (func $La (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $K
(get_local $0)
)
)
- (func $Ga (; 44 ;) (param $0 i32)
+ (func $Ga (; 44 ;) (; has Stack IR ;) (param $0 i32)
(set_global $r
(get_local $0)
)
)
- (func $Ma (; 45 ;) (result i32)
+ (func $Ma (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $K)
)
- (func $Fa (; 46 ;) (result i32)
+ (func $Fa (; 46 ;) (; has Stack IR ;) (result i32)
(get_global $r)
)
- (func $ib (; 47 ;) (result i32)
+ (func $ib (; 47 ;) (; has Stack IR ;) (result i32)
(i32.const 0)
)
)
diff --git a/test/memorygrowth.fromasm.clamp b/test/memorygrowth.fromasm.clamp
index cf5cf85c2..5afec926b 100644
--- a/test/memorygrowth.fromasm.clamp
+++ b/test/memorygrowth.fromasm.clamp
@@ -50,12 +50,12 @@
(export "dynCall_ii" (func $kb))
(export "dynCall_iiii" (func $lb))
(export "dynCall_vi" (func $mb))
- (func $__growWasmMemory (; 12 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
)
- (func $eb (; 13 ;) (param $0 i32) (result i32)
+ (func $eb (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5877,7 +5877,7 @@
(i32.const 8)
)
)
- (func $fb (; 14 ;) (param $0 i32)
+ (func $fb (; 14 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7698,7 +7698,7 @@
(i32.const -1)
)
)
- (func $Ra (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ra (; 15 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8072,7 +8072,7 @@
)
(get_local $15)
)
- (func $Wa (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Wa (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8284,7 +8284,7 @@
)
(get_local $4)
)
- (func $Za (; 17 ;) (param $0 i32) (result i32)
+ (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8428,7 +8428,7 @@
(get_local $3)
)
)
- (func $_a (; 18 ;) (param $0 i32) (result i32)
+ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(tee_local $1
@@ -8532,7 +8532,7 @@
)
)
)
- (func $ab (; 19 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ab (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8681,7 +8681,7 @@
)
(get_local $4)
)
- (func $$a (; 20 ;) (param $0 i32) (result i32)
+ (func $$a (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8816,7 +8816,7 @@
)
(get_local $2)
)
- (func $jb (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8963,10 +8963,10 @@
)
(get_local $3)
)
- (func $gb (; 22 ;)
+ (func $gb (; 22 ;) (; has Stack IR ;)
(nop)
)
- (func $hb (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $hb (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9104,7 +9104,7 @@
(get_local $2)
)
)
- (func $db (; 24 ;) (param $0 i32) (result i32)
+ (func $db (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(drop
@@ -9194,7 +9194,7 @@
(i32.const 31)
)
)
- (func $Xa (; 25 ;) (param $0 i32) (result i32)
+ (func $Xa (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9272,7 +9272,7 @@
)
)
)
- (func $bb (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $bb (; 26 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9311,7 +9311,7 @@
)
(get_local $2)
)
- (func $Ua (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ua (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9380,7 +9380,7 @@
)
(get_local $0)
)
- (func $Va (; 28 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Va (; 28 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9450,7 +9450,7 @@
)
(get_local $3)
)
- (func $Oa (; 29 ;) (param $0 i32) (result i32)
+ (func $Oa (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9480,7 +9480,7 @@
)
(get_local $0)
)
- (func $Pa (; 30 ;) (param $0 i32) (result i32)
+ (func $Pa (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9499,7 +9499,7 @@
(get_local $0)
)
)
- (func $Qa (; 31 ;) (result i32)
+ (func $Qa (; 31 ;) (; has Stack IR ;) (result i32)
(if (result i32)
(i32.load
(i32.const 1160)
@@ -9510,7 +9510,7 @@
(i32.const 1204)
)
)
- (func $lb (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $lb (; 32 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9524,7 +9524,7 @@
)
)
)
- (func $Ea (; 33 ;) (param $0 i32) (result i32)
+ (func $Ea (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9546,13 +9546,13 @@
)
(get_local $1)
)
- (func $ob (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $ob (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $ja
(i32.const 1)
)
(i32.const 0)
)
- (func $Ia (; 35 ;) (param $0 i32) (param $1 i32)
+ (func $Ia (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $v)
@@ -9567,7 +9567,7 @@
)
)
)
- (func $kb (; 36 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $kb (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9576,14 +9576,14 @@
)
)
)
- (func $Sa (; 37 ;) (param $0 i32)
+ (func $Sa (; 37 ;) (; has Stack IR ;) (param $0 i32)
(drop
(i32.load offset=68
(get_local $0)
)
)
)
- (func $mb (; 38 ;) (param $0 i32) (param $1 i32)
+ (func $mb (; 38 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9595,7 +9595,7 @@
)
)
)
- (func $Ha (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $Ha (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $r
(get_local $0)
)
@@ -9603,13 +9603,13 @@
(get_local $1)
)
)
- (func $nb (; 40 ;) (param $0 i32) (result i32)
+ (func $nb (; 40 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $ja
(i32.const 0)
)
(i32.const 0)
)
- (func $Na (; 41 ;) (result i32)
+ (func $Na (; 41 ;) (; has Stack IR ;) (result i32)
(drop
(call $db
(i32.const 1144)
@@ -9617,28 +9617,28 @@
)
(i32.const 0)
)
- (func $pb (; 42 ;) (param $0 i32)
+ (func $pb (; 42 ;) (; has Stack IR ;) (param $0 i32)
(call $ja
(i32.const 2)
)
)
- (func $La (; 43 ;) (param $0 i32)
+ (func $La (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $K
(get_local $0)
)
)
- (func $Ga (; 44 ;) (param $0 i32)
+ (func $Ga (; 44 ;) (; has Stack IR ;) (param $0 i32)
(set_global $r
(get_local $0)
)
)
- (func $Ma (; 45 ;) (result i32)
+ (func $Ma (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $K)
)
- (func $Fa (; 46 ;) (result i32)
+ (func $Fa (; 46 ;) (; has Stack IR ;) (result i32)
(get_global $r)
)
- (func $ib (; 47 ;) (result i32)
+ (func $ib (; 47 ;) (; has Stack IR ;) (result i32)
(i32.const 0)
)
)
diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise
index 5512eab04..c71b3b697 100644
--- a/test/memorygrowth.fromasm.imprecise
+++ b/test/memorygrowth.fromasm.imprecise
@@ -48,12 +48,12 @@
(export "dynCall_ii" (func $kb))
(export "dynCall_iiii" (func $lb))
(export "dynCall_vi" (func $mb))
- (func $__growWasmMemory (; 12 ;) (param $0 i32) (result i32)
+ (func $__growWasmMemory (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(grow_memory
(get_local $0)
)
)
- (func $eb (; 13 ;) (param $0 i32) (result i32)
+ (func $eb (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -5875,7 +5875,7 @@
(i32.const 8)
)
)
- (func $fb (; 14 ;) (param $0 i32)
+ (func $fb (; 14 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -7696,7 +7696,7 @@
(i32.const -1)
)
)
- (func $Ra (; 15 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ra (; 15 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8070,7 +8070,7 @@
)
(get_local $15)
)
- (func $Wa (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Wa (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -8282,7 +8282,7 @@
)
(get_local $4)
)
- (func $Za (; 17 ;) (param $0 i32) (result i32)
+ (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8426,7 +8426,7 @@
(get_local $3)
)
)
- (func $_a (; 18 ;) (param $0 i32) (result i32)
+ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(tee_local $1
@@ -8525,7 +8525,7 @@
)
)
)
- (func $ab (; 19 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ab (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@@ -8674,7 +8674,7 @@
)
(get_local $4)
)
- (func $$a (; 20 ;) (param $0 i32) (result i32)
+ (func $$a (; 20 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@@ -8809,7 +8809,7 @@
)
(get_local $2)
)
- (func $jb (; 21 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.ge_s
@@ -8956,10 +8956,10 @@
)
(get_local $3)
)
- (func $gb (; 22 ;)
+ (func $gb (; 22 ;) (; has Stack IR ;)
(nop)
)
- (func $hb (; 23 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $hb (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -9097,7 +9097,7 @@
(get_local $2)
)
)
- (func $db (; 24 ;) (param $0 i32) (result i32)
+ (func $db (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(drop
@@ -9187,7 +9187,7 @@
(i32.const 31)
)
)
- (func $Xa (; 25 ;) (param $0 i32) (result i32)
+ (func $Xa (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $2
@@ -9265,7 +9265,7 @@
)
)
)
- (func $bb (; 26 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $bb (; 26 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(set_local $4
(i32.mul
@@ -9293,7 +9293,7 @@
)
(get_local $2)
)
- (func $Ua (; 27 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Ua (; 27 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9362,7 +9362,7 @@
)
(get_local $0)
)
- (func $Va (; 28 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $Va (; 28 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(set_local $4
@@ -9432,7 +9432,7 @@
)
(get_local $3)
)
- (func $Oa (; 29 ;) (param $0 i32) (result i32)
+ (func $Oa (; 29 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9462,7 +9462,7 @@
)
(get_local $0)
)
- (func $Pa (; 30 ;) (param $0 i32) (result i32)
+ (func $Pa (; 30 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if (result i32)
(i32.gt_u
(get_local $0)
@@ -9481,7 +9481,7 @@
(get_local $0)
)
)
- (func $Qa (; 31 ;) (result i32)
+ (func $Qa (; 31 ;) (; has Stack IR ;) (result i32)
(select
(i32.load
(i32.const 64)
@@ -9492,7 +9492,7 @@
)
)
)
- (func $lb (; 32 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $lb (; 32 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(call_indirect (type $FUNCSIG$iiii)
(get_local $1)
(get_local $2)
@@ -9506,7 +9506,7 @@
)
)
)
- (func $Ea (; 33 ;) (param $0 i32) (result i32)
+ (func $Ea (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(get_global $r)
@@ -9528,13 +9528,13 @@
)
(get_local $1)
)
- (func $ob (; 34 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $ob (; 34 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $ja
(i32.const 1)
)
(i32.const 0)
)
- (func $Ia (; 35 ;) (param $0 i32) (param $1 i32)
+ (func $Ia (; 35 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(if
(i32.eqz
(get_global $v)
@@ -9549,7 +9549,7 @@
)
)
)
- (func $kb (; 36 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $kb (; 36 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call_indirect (type $FUNCSIG$ii)
(get_local $1)
(i32.and
@@ -9558,10 +9558,10 @@
)
)
)
- (func $Sa (; 37 ;) (param $0 i32)
+ (func $Sa (; 37 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $mb (; 38 ;) (param $0 i32) (param $1 i32)
+ (func $mb (; 38 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(call_indirect (type $FUNCSIG$vi)
(get_local $1)
(i32.add
@@ -9573,7 +9573,7 @@
)
)
)
- (func $Ha (; 39 ;) (param $0 i32) (param $1 i32)
+ (func $Ha (; 39 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(set_global $r
(get_local $0)
)
@@ -9581,13 +9581,13 @@
(get_local $1)
)
)
- (func $nb (; 40 ;) (param $0 i32) (result i32)
+ (func $nb (; 40 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(call $ja
(i32.const 0)
)
(i32.const 0)
)
- (func $Na (; 41 ;) (result i32)
+ (func $Na (; 41 ;) (; has Stack IR ;) (result i32)
(drop
(call $db
(i32.const 1144)
@@ -9595,28 +9595,28 @@
)
(i32.const 0)
)
- (func $pb (; 42 ;) (param $0 i32)
+ (func $pb (; 42 ;) (; has Stack IR ;) (param $0 i32)
(call $ja
(i32.const 2)
)
)
- (func $La (; 43 ;) (param $0 i32)
+ (func $La (; 43 ;) (; has Stack IR ;) (param $0 i32)
(set_global $K
(get_local $0)
)
)
- (func $Ga (; 44 ;) (param $0 i32)
+ (func $Ga (; 44 ;) (; has Stack IR ;) (param $0 i32)
(set_global $r
(get_local $0)
)
)
- (func $Ma (; 45 ;) (result i32)
+ (func $Ma (; 45 ;) (; has Stack IR ;) (result i32)
(get_global $K)
)
- (func $Fa (; 46 ;) (result i32)
+ (func $Fa (; 46 ;) (; has Stack IR ;) (result i32)
(get_global $r)
)
- (func $ib (; 47 ;) (result i32)
+ (func $ib (; 47 ;) (; has Stack IR ;) (result i32)
(i32.const 0)
)
)
diff --git a/test/min.fromasm b/test/min.fromasm
index 1f68b2acf..d46362b92 100644
--- a/test/min.fromasm
+++ b/test/min.fromasm
@@ -8,16 +8,16 @@
(export "neg" (func $legalstub$neg))
(export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
- (func $ctzzzz (; 0 ;) (result i32)
+ (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32)
(i32.const 2)
)
- (func $ub (; 1 ;) (result i32)
+ (func $ub (; 1 ;) (; has Stack IR ;) (result i32)
(drop
(call $ub)
)
(get_global $M)
)
- (func $legalstub$floats (; 2 ;) (param $0 f64) (result f64)
+ (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.promote/f32
(f32.add
(f32.const 0)
@@ -27,7 +27,7 @@
)
)
)
- (func $legalstub$neg (; 3 ;) (param $0 i32) (param $1 i32) (result f64)
+ (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64)
(i32.store
(get_local $0)
(get_local $1)
@@ -40,7 +40,7 @@
)
)
)
- (func $legalstub$bitcasts (; 4 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
)
diff --git a/test/min.fromasm.clamp b/test/min.fromasm.clamp
index 1f68b2acf..d46362b92 100644
--- a/test/min.fromasm.clamp
+++ b/test/min.fromasm.clamp
@@ -8,16 +8,16 @@
(export "neg" (func $legalstub$neg))
(export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
- (func $ctzzzz (; 0 ;) (result i32)
+ (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32)
(i32.const 2)
)
- (func $ub (; 1 ;) (result i32)
+ (func $ub (; 1 ;) (; has Stack IR ;) (result i32)
(drop
(call $ub)
)
(get_global $M)
)
- (func $legalstub$floats (; 2 ;) (param $0 f64) (result f64)
+ (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.promote/f32
(f32.add
(f32.const 0)
@@ -27,7 +27,7 @@
)
)
)
- (func $legalstub$neg (; 3 ;) (param $0 i32) (param $1 i32) (result f64)
+ (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64)
(i32.store
(get_local $0)
(get_local $1)
@@ -40,7 +40,7 @@
)
)
)
- (func $legalstub$bitcasts (; 4 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
)
diff --git a/test/min.fromasm.imprecise b/test/min.fromasm.imprecise
index 444551428..997d2fbf0 100644
--- a/test/min.fromasm.imprecise
+++ b/test/min.fromasm.imprecise
@@ -6,16 +6,16 @@
(export "neg" (func $legalstub$neg))
(export "bitcasts" (func $legalstub$bitcasts))
(export "ctzzzz" (func $ctzzzz))
- (func $ctzzzz (; 0 ;) (result i32)
+ (func $ctzzzz (; 0 ;) (; has Stack IR ;) (result i32)
(i32.const 2)
)
- (func $ub (; 1 ;) (result i32)
+ (func $ub (; 1 ;) (; has Stack IR ;) (result i32)
(drop
(call $ub)
)
(get_global $M)
)
- (func $legalstub$floats (; 2 ;) (param $0 f64) (result f64)
+ (func $legalstub$floats (; 2 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.promote/f32
(f32.add
(f32.const 0)
@@ -25,7 +25,7 @@
)
)
)
- (func $legalstub$neg (; 3 ;) (param $0 i32) (param $1 i32) (result f64)
+ (func $legalstub$neg (; 3 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result f64)
(i32.store
(get_local $0)
(get_local $1)
@@ -38,7 +38,7 @@
)
)
)
- (func $legalstub$bitcasts (; 4 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 4 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
)
diff --git a/test/noffi_f32.fromasm b/test/noffi_f32.fromasm
index 00ca4dc3d..ae0b26a6d 100644
--- a/test/noffi_f32.fromasm
+++ b/test/noffi_f32.fromasm
@@ -6,13 +6,13 @@
(data (get_global $memoryBase) "noffi_f32.asm.js")
(export "main" (func $main))
(export "exportf" (func $exportf))
- (func $exportf (; 1 ;) (param $0 f32) (result f32)
+ (func $exportf (; 1 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.add
(get_local $0)
(f32.const 1)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importf
(f32.const 3.4000000953674316)
diff --git a/test/noffi_f32.fromasm.clamp b/test/noffi_f32.fromasm.clamp
index 00ca4dc3d..ae0b26a6d 100644
--- a/test/noffi_f32.fromasm.clamp
+++ b/test/noffi_f32.fromasm.clamp
@@ -6,13 +6,13 @@
(data (get_global $memoryBase) "noffi_f32.asm.js")
(export "main" (func $main))
(export "exportf" (func $exportf))
- (func $exportf (; 1 ;) (param $0 f32) (result f32)
+ (func $exportf (; 1 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.add
(get_local $0)
(f32.const 1)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importf
(f32.const 3.4000000953674316)
diff --git a/test/noffi_f32.fromasm.imprecise b/test/noffi_f32.fromasm.imprecise
index 85fc2b07c..60d6df1d1 100644
--- a/test/noffi_f32.fromasm.imprecise
+++ b/test/noffi_f32.fromasm.imprecise
@@ -3,13 +3,13 @@
(import "env" "_importf" (func $importf (param f32) (result f32)))
(export "main" (func $main))
(export "exportf" (func $exportf))
- (func $exportf (; 1 ;) (param $0 f32) (result f32)
+ (func $exportf (; 1 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.add
(get_local $0)
(f32.const 1)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importf
(f32.const 3.4000000953674316)
diff --git a/test/noffi_i64.fromasm b/test/noffi_i64.fromasm
index 1254149fa..69fbe532b 100644
--- a/test/noffi_i64.fromasm
+++ b/test/noffi_i64.fromasm
@@ -6,13 +6,13 @@
(data (get_global $memoryBase) "noffi_i64.asm.js")
(export "_add" (func $add))
(export "_main" (func $main))
- (func $add (; 1 ;) (param $0 i64) (param $1 i64) (result i64)
+ (func $add (; 1 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64)
(i64.add
(get_local $1)
(get_local $0)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importll
(i64.const 2)
diff --git a/test/noffi_i64.fromasm.clamp b/test/noffi_i64.fromasm.clamp
index 1254149fa..69fbe532b 100644
--- a/test/noffi_i64.fromasm.clamp
+++ b/test/noffi_i64.fromasm.clamp
@@ -6,13 +6,13 @@
(data (get_global $memoryBase) "noffi_i64.asm.js")
(export "_add" (func $add))
(export "_main" (func $main))
- (func $add (; 1 ;) (param $0 i64) (param $1 i64) (result i64)
+ (func $add (; 1 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64)
(i64.add
(get_local $1)
(get_local $0)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importll
(i64.const 2)
diff --git a/test/noffi_i64.fromasm.imprecise b/test/noffi_i64.fromasm.imprecise
index 8eb41d2b8..7cdc838fb 100644
--- a/test/noffi_i64.fromasm.imprecise
+++ b/test/noffi_i64.fromasm.imprecise
@@ -3,13 +3,13 @@
(import "env" "_importll" (func $importll (param i64) (result i64)))
(export "_add" (func $add))
(export "_main" (func $main))
- (func $add (; 1 ;) (param $0 i64) (param $1 i64) (result i64)
+ (func $add (; 1 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64)
(i64.add
(get_local $1)
(get_local $0)
)
)
- (func $main (; 2 ;) (result i32)
+ (func $main (; 2 ;) (; has Stack IR ;) (result i32)
(drop
(call $importll
(i64.const 2)
diff --git a/test/passes/O.bin.txt b/test/passes/O.bin.txt
index d1f85899f..ae3bda836 100644
--- a/test/passes/O.bin.txt
+++ b/test/passes/O.bin.txt
@@ -5,7 +5,7 @@
(export "fac-iter" (func $2))
(export "fac-iter-named" (func $3))
(export "fac-opt" (func $4))
- (func $0 (; 0 ;) (type $0) (param $0 i64) (result i64)
+ (func $0 (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i64) (result i64)
(if (result i64)
(i64.eq
(get_local $0)
@@ -23,7 +23,7 @@
)
)
)
- (func $1 (; 1 ;) (type $0) (param $0 i64) (result i64)
+ (func $1 (; 1 ;) (; has Stack IR ;) (type $0) (param $0 i64) (result i64)
(if (result i64)
(i64.eq
(get_local $0)
@@ -41,10 +41,10 @@
)
)
)
- (func $2 (; 2 ;) (type $0) (param $0 i64) (result i64)
+ (func $2 (; 2 ;) (; has Stack IR ;) (type $0) (param $0 i64) (result i64)
(unreachable)
)
- (func $3 (; 3 ;) (type $0) (param $0 i64) (result i64)
+ (func $3 (; 3 ;) (; has Stack IR ;) (type $0) (param $0 i64) (result i64)
(local $1 i64)
(set_local $1
(i64.const 1)
@@ -74,7 +74,7 @@
)
(get_local $1)
)
- (func $4 (; 4 ;) (type $0) (param $0 i64) (result i64)
+ (func $4 (; 4 ;) (; has Stack IR ;) (type $0) (param $0 i64) (result i64)
(local $1 i64)
(set_local $1
(i64.const 1)
diff --git a/test/passes/O.txt b/test/passes/O.txt
index 390f0783b..dcf9257c3 100644
--- a/test/passes/O.txt
+++ b/test/passes/O.txt
@@ -3,7 +3,7 @@
(type $1 (func (param i64)))
(export "ret" (func $ret))
(export "waka" (func $if-0-unreachable-to-none))
- (func $ret (; 0 ;) (type $0) (result i32)
+ (func $ret (; 0 ;) (; has Stack IR ;) (type $0) (result i32)
(block $out (result i32)
(drop
(call $ret)
@@ -17,7 +17,7 @@
(i32.const 999)
)
)
- (func $if-0-unreachable-to-none (; 1 ;) (type $1) (param $0 i64)
+ (func $if-0-unreachable-to-none (; 1 ;) (; has Stack IR ;) (type $1) (param $0 i64)
(unreachable)
)
)
diff --git a/test/passes/O1_print-stack-ir.txt b/test/passes/O1_print-stack-ir.txt
new file mode 100644
index 000000000..ab3bf9255
--- /dev/null
+++ b/test/passes/O1_print-stack-ir.txt
@@ -0,0 +1,29 @@
+$stacky-help:
+ (no stack ir)
+(module
+ (type $0 (func (param i32) (result i32)))
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (; 0 ;) (type $0) (param $0 i32) (result i32)
+ (local $1 i32)
+ (i32.add
+ (call $stacky-help
+ (i32.const 0)
+ )
+ (block (result i32)
+ (set_local $1
+ (call $stacky-help
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $stacky-help
+ (i32.const 2)
+ )
+ )
+ (i32.eqz
+ (get_local $1)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O1_print-stack-ir.wast b/test/passes/O1_print-stack-ir.wast
new file mode 100644
index 000000000..a53d9d51e
--- /dev/null
+++ b/test/passes/O1_print-stack-ir.wast
@@ -0,0 +1,16 @@
+(module
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $stacky-help (i32.const 0))
+ (i32.eqz
+ (block (result i32) ;; after we use the stack instead of the local, we can remove this block
+ (set_local $temp (call $stacky-help (i32.const 1)))
+ (drop (call $stacky-help (i32.const 2)))
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O2_precompute-propagate_print-stack-ir.txt b/test/passes/O2_precompute-propagate_print-stack-ir.txt
new file mode 100644
index 000000000..6c3ee8ee1
--- /dev/null
+++ b/test/passes/O2_precompute-propagate_print-stack-ir.txt
@@ -0,0 +1,16 @@
+$0:
+ (no stack ir)
+(module
+ (type $0 (func (param i32 i32 i32 i64) (result i64)))
+ (export "func" (func $0))
+ (func $0 (; 0 ;) (type $0) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i64) (result i64)
+ (local $4 i32)
+ (block $label$1
+ (set_local $3
+ (i64.const 2147483647)
+ )
+ (nop)
+ )
+ (i64.const 2147483647)
+ )
+)
diff --git a/test/passes/O2_precompute-propagate_print-stack-ir.wast b/test/passes/O2_precompute-propagate_print-stack-ir.wast
new file mode 100644
index 000000000..f6f0dae9f
--- /dev/null
+++ b/test/passes/O2_precompute-propagate_print-stack-ir.wast
@@ -0,0 +1,18 @@
+(module
+ (func "func" (param $var$0 i32) (param $var$1 i32) (param $var$2 i32) (param $var$3 i64) (result i64)
+ (local $var$4 i32)
+ (block $label$1
+ (set_local $var$3
+ (i64.const 2147483647)
+ )
+ (br_if $label$1
+ (get_local $var$4) ;; precompute-propagate will optimize this into 0, then the br_if is nopped
+ ;; in place. if stack ir is not regenerated, that means we have the get
+ ;; on the stack from before, and the br_if is now a nop, which means no one
+ ;; pops the get
+ )
+ )
+ (get_local $var$3)
+ )
+)
+
diff --git a/test/passes/O2_print-stack-ir.txt b/test/passes/O2_print-stack-ir.txt
new file mode 100644
index 000000000..aa2a91528
--- /dev/null
+++ b/test/passes/O2_print-stack-ir.txt
@@ -0,0 +1,40 @@
+$stacky-help:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 set_local (none)
+5 const (i32)
+6 call (i32)
+7 drop (none)
+8 get_local (i32)
+9 unary (i32)
+10 binary (i32)
+
+(module
+ (type $0 (func (param i32) (result i32)))
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (result i32)
+ (local $1 i32)
+ (i32.add
+ (call $stacky-help
+ (i32.const 0)
+ )
+ (block (result i32)
+ (set_local $1
+ (call $stacky-help
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $stacky-help
+ (i32.const 2)
+ )
+ )
+ (i32.eqz
+ (get_local $1)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O2_print-stack-ir.wast b/test/passes/O2_print-stack-ir.wast
new file mode 100644
index 000000000..a53d9d51e
--- /dev/null
+++ b/test/passes/O2_print-stack-ir.wast
@@ -0,0 +1,16 @@
+(module
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $stacky-help (i32.const 0))
+ (i32.eqz
+ (block (result i32) ;; after we use the stack instead of the local, we can remove this block
+ (set_local $temp (call $stacky-help (i32.const 1)))
+ (drop (call $stacky-help (i32.const 2)))
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O3_print-stack-ir.txt b/test/passes/O3_print-stack-ir.txt
new file mode 100644
index 000000000..ca1cc46ba
--- /dev/null
+++ b/test/passes/O3_print-stack-ir.txt
@@ -0,0 +1,38 @@
+$stacky-help:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 const (i32)
+5 call (i32)
+6 drop (none)
+7 unary (i32)
+8 binary (i32)
+
+(module
+ (type $0 (func (param i32) (result i32)))
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (result i32)
+ (local $1 i32)
+ (i32.add
+ (call $stacky-help
+ (i32.const 0)
+ )
+ (block (result i32)
+ (set_local $1
+ (call $stacky-help
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $stacky-help
+ (i32.const 2)
+ )
+ )
+ (i32.eqz
+ (get_local $1)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O3_print-stack-ir.wast b/test/passes/O3_print-stack-ir.wast
new file mode 100644
index 000000000..a53d9d51e
--- /dev/null
+++ b/test/passes/O3_print-stack-ir.wast
@@ -0,0 +1,16 @@
+(module
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $stacky-help (i32.const 0))
+ (i32.eqz
+ (block (result i32) ;; after we use the stack instead of the local, we can remove this block
+ (set_local $temp (call $stacky-help (i32.const 1)))
+ (drop (call $stacky-help (i32.const 2)))
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/O4.txt b/test/passes/O4.txt
index 1939a740e..9a64b18ff 100644
--- a/test/passes/O4.txt
+++ b/test/passes/O4.txt
@@ -2,7 +2,7 @@
(type $0 (func))
(global $global$0 (mut i32) (i32.const 10))
(export "func_59_invoker" (func $0))
- (func $0 (; 0 ;) (type $0)
+ (func $0 (; 0 ;) (; has Stack IR ;) (type $0)
(set_global $global$0
(i32.const 0)
)
diff --git a/test/passes/Os_print-stack-ir.txt b/test/passes/Os_print-stack-ir.txt
new file mode 100644
index 000000000..ca1cc46ba
--- /dev/null
+++ b/test/passes/Os_print-stack-ir.txt
@@ -0,0 +1,38 @@
+$stacky-help:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 const (i32)
+5 call (i32)
+6 drop (none)
+7 unary (i32)
+8 binary (i32)
+
+(module
+ (type $0 (func (param i32) (result i32)))
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (result i32)
+ (local $1 i32)
+ (i32.add
+ (call $stacky-help
+ (i32.const 0)
+ )
+ (block (result i32)
+ (set_local $1
+ (call $stacky-help
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $stacky-help
+ (i32.const 2)
+ )
+ )
+ (i32.eqz
+ (get_local $1)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/Os_print-stack-ir.wast b/test/passes/Os_print-stack-ir.wast
new file mode 100644
index 000000000..a53d9d51e
--- /dev/null
+++ b/test/passes/Os_print-stack-ir.wast
@@ -0,0 +1,16 @@
+(module
+ (export "stacky-help" (func $stacky-help))
+ (func $stacky-help (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $stacky-help (i32.const 0))
+ (i32.eqz
+ (block (result i32) ;; after we use the stack instead of the local, we can remove this block
+ (set_local $temp (call $stacky-help (i32.const 1)))
+ (drop (call $stacky-help (i32.const 2)))
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/Oz.txt b/test/passes/Oz.txt
index 883ccc476..a59ac924b 100644
--- a/test/passes/Oz.txt
+++ b/test/passes/Oz.txt
@@ -4,7 +4,7 @@
(memory $0 100 100)
(export "localcse" (func $basics))
(export "localcse-2" (func $8))
- (func $basics (; 0 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (func $basics (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(i32.add
(get_local $0)
@@ -16,7 +16,7 @@
)
)
)
- (func $8 (; 1 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
+ (func $8 (; 1 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(i32.store
(tee_local $2
(i32.add
diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt
index 47e01cdbe..a272a6288 100644
--- a/test/passes/converge_O3_metrics.bin.txt
+++ b/test/passes/converge_O3_metrics.bin.txt
@@ -42,13 +42,13 @@ total
(data (i32.const 18764) "`\0b")
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
- (func $b0 (; 1 ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
+ (func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
(i32.const 0)
)
- (func $_malloc (; 2 ;) (type $2) (param $0 i32) (result i32)
+ (func $_malloc (; 2 ;) (; has Stack IR ;) (type $2) (param $0 i32) (result i32)
(i32.const 0)
)
- (func $___stdio_write (; 3 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 3 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.store
(i32.const 8)
(get_local $1)
@@ -79,7 +79,7 @@ total
)
(i32.const 1)
)
- (func $_main (; 4 ;) (type $7) (result i32)
+ (func $_main (; 4 ;) (; has Stack IR ;) (type $7) (result i32)
(local $0 i32)
(call $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j
(block (result i32)
@@ -109,7 +109,7 @@ total
)
(i32.const 0)
)
- (func $___stdout_write (; 5 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 5 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(set_global $global$0
(i32.const 32)
)
@@ -119,7 +119,7 @@ total
(get_local $2)
)
)
- (func $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j (; 6 ;) (type $3) (param $0 i32)
+ (func $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j (; 6 ;) (; has Stack IR ;) (type $3) (param $0 i32)
(local $1 i32)
(set_local $1
(i32.load offset=24
@@ -157,7 +157,7 @@ total
)
)
)
- (func $__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc (; 7 ;) (type $3) (param $0 i32)
+ (func $__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc (; 7 ;) (; has Stack IR ;) (type $3) (param $0 i32)
(local $1 i32)
(local $2 i32)
(block $label$1
@@ -202,7 +202,7 @@ total
)
)
)
- (func $__ZNSt3__211__stdoutbufIcE8overflowEi (; 8 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (func $__ZNSt3__211__stdoutbufIcE8overflowEi (; 8 ;) (; has Stack IR ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
(i32.store8
(i32.const 0)
(get_local $1)
@@ -227,7 +227,7 @@ total
)
(i32.const 0)
)
- (func $__ZNSt3__211__stdoutbufIcE6xsputnEPKci (; 9 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $__ZNSt3__211__stdoutbufIcE6xsputnEPKci (; 9 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(drop
(call_indirect (type $1)
(i32.const 0)
@@ -290,13 +290,13 @@ total
(data (i32.const 18764) "`\0b")
(export "_main" (func $_main))
(export "_malloc" (func $_malloc))
- (func $b0 (; 1 ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
+ (func $b0 (; 1 ;) (; has Stack IR ;) (type $6) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32) (result i32)
(i32.const 0)
)
- (func $_malloc (; 2 ;) (type $2) (param $0 i32) (result i32)
+ (func $_malloc (; 2 ;) (; has Stack IR ;) (type $2) (param $0 i32) (result i32)
(i32.const 0)
)
- (func $___stdio_write (; 3 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdio_write (; 3 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.store
(i32.const 8)
(get_local $1)
@@ -327,7 +327,7 @@ total
)
(i32.const 1)
)
- (func $_main (; 4 ;) (type $7) (result i32)
+ (func $_main (; 4 ;) (; has Stack IR ;) (type $7) (result i32)
(local $0 i32)
(call $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j
(block (result i32)
@@ -357,7 +357,7 @@ total
)
(i32.const 0)
)
- (func $___stdout_write (; 5 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $___stdout_write (; 5 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(set_global $global$0
(i32.const 32)
)
@@ -367,7 +367,7 @@ total
(get_local $2)
)
)
- (func $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j (; 6 ;) (type $3) (param $0 i32)
+ (func $__ZNSt3__224__put_character_sequenceIcNS_11char_traitsIcEEEERNS_13basic_ostreamIT_T0_EES7_PKS4_j (; 6 ;) (; has Stack IR ;) (type $3) (param $0 i32)
(local $1 i32)
(set_local $1
(i32.load offset=24
@@ -405,7 +405,7 @@ total
)
)
)
- (func $__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc (; 7 ;) (type $3) (param $0 i32)
+ (func $__ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEE3putEc (; 7 ;) (; has Stack IR ;) (type $3) (param $0 i32)
(local $1 i32)
(local $2 i32)
(block $label$1
@@ -450,7 +450,7 @@ total
)
)
)
- (func $__ZNSt3__211__stdoutbufIcE8overflowEi (; 8 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (func $__ZNSt3__211__stdoutbufIcE8overflowEi (; 8 ;) (; has Stack IR ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
(i32.store8
(i32.const 0)
(get_local $1)
@@ -475,7 +475,7 @@ total
)
(i32.const 0)
)
- (func $__ZNSt3__211__stdoutbufIcE6xsputnEPKci (; 9 ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $__ZNSt3__211__stdoutbufIcE6xsputnEPKci (; 9 ;) (; has Stack IR ;) (type $1) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(drop
(call_indirect (type $1)
(i32.const 0)
diff --git a/test/passes/flatten_local-cse_Os.txt b/test/passes/flatten_local-cse_Os.txt
index 85bc4d6f5..4c95a1df5 100644
--- a/test/passes/flatten_local-cse_Os.txt
+++ b/test/passes/flatten_local-cse_Os.txt
@@ -1,7 +1,7 @@
(module
(type $0 (func (param i32 i32) (result i32)))
(export "div16_internal" (func $0))
- (func $0 (; 0 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (func $0 (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(tee_local $0
(i32.xor
diff --git a/test/passes/fuzz-exec_O.txt b/test/passes/fuzz-exec_O.txt
index 8ebd35fa1..dd90a838c 100644
--- a/test/passes/fuzz-exec_O.txt
+++ b/test/passes/fuzz-exec_O.txt
@@ -7,7 +7,7 @@
(memory $0 1 1)
(export "func_0" (func $func_0))
(export "func_1" (func $func_1))
- (func $func_0 (; 0 ;) (type $0) (result i64)
+ (func $func_0 (; 0 ;) (; has Stack IR ;) (type $0) (result i64)
(block $label$0 (result i64)
(br_if $label$0
(i64.const 1234)
@@ -17,7 +17,7 @@
)
)
)
- (func $func_1 (; 1 ;) (type $1) (result i32)
+ (func $func_1 (; 1 ;) (; has Stack IR ;) (type $1) (result i32)
(i32.load16_s offset=22 align=1
(i32.const -1)
)
diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt
new file mode 100644
index 000000000..11c33366c
--- /dev/null
+++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.txt
@@ -0,0 +1,1540 @@
+$big_negative:
+0 const (f64)
+1 set_local (none)
+2 const (f64)
+3 set_local (none)
+4 const (f64)
+5 set_local (none)
+6 const (f64)
+7 set_local (none)
+8 const (f64)
+9 set_local (none)
+
+$importedDoubles:
+0 block
+1 const (i32)
+2 load (f64)
+3 const (i32)
+4 load (f64)
+5 binary (f64)
+6 const (i32)
+7 load (f64)
+8 unary (f64)
+9 binary (f64)
+10 const (i32)
+11 load (f64)
+12 unary (f64)
+13 binary (f64)
+14 set_local (none)
+15 const (i32)
+16 load (i32)
+17 const (i32)
+18 binary (i32)
+19 if
+20 const (f64)
+21 break (unreachable)
+22 end (none)
+23 const (i32)
+24 load (f64)
+25 const (f64)
+26 binary (i32)
+27 if
+28 const (f64)
+29 break (unreachable)
+30 end (none)
+31 const (f64)
+32 end (f64)
+
+$doubleCompares:
+0 block
+1 get_local (f64)
+2 const (f64)
+3 binary (i32)
+4 if
+5 const (f64)
+6 break (unreachable)
+7 end (none)
+8 get_local (f64)
+9 const (f64)
+10 binary (i32)
+11 if
+12 const (f64)
+13 break (unreachable)
+14 end (none)
+15 get_local (i32)
+16 const (i32)
+17 binary (i32)
+18 if
+19 const (f64)
+20 break (unreachable)
+21 end (none)
+22 get_local (f64)
+23 get_local (f64)
+24 binary (i32)
+25 if
+26 get_local (f64)
+27 break (unreachable)
+28 end (none)
+29 get_local (f64)
+30 end (f64)
+
+$intOps:
+0 get_local (i32)
+1 const (i32)
+2 binary (i32)
+
+$hexLiterals:
+0 const (i32)
+1 const (i32)
+2 binary (i32)
+3 const (i32)
+4 binary (i32)
+5 drop (none)
+
+$conversions:
+0 get_local (f64)
+1 call_import (i32)
+2 set_local (none)
+3 get_local (i32)
+4 unary (f64)
+5 set_local (none)
+6 get_local (i32)
+7 const (i32)
+8 binary (i32)
+9 unary (f64)
+10 set_local (none)
+
+$seq:
+0 const (f64)
+1 drop (none)
+2 const (f64)
+3 const (f64)
+4 drop (none)
+5 const (f64)
+6 binary (f64)
+7 set_local (none)
+
+$switcher:
+0 block
+1 block
+2 block
+3 block
+4 get_local (i32)
+5 const (i32)
+6 binary (i32)
+7 switch (unreachable)
+8 end (none)
+9 const (i32)
+10 break (unreachable)
+11 end (none)
+12 const (i32)
+13 break (unreachable)
+14 end (none)
+15 nop (none)
+16 block
+17 block
+18 block
+19 get_local (i32)
+20 const (i32)
+21 binary (i32)
+22 switch (unreachable)
+23 end (none)
+24 const (i32)
+25 break (unreachable)
+26 end (none)
+27 const (i32)
+28 break (unreachable)
+29 end (none)
+30 nop (none)
+31 block
+32 block
+33 block
+34 block
+35 block
+36 block
+37 get_local (i32)
+38 const (i32)
+39 binary (i32)
+40 switch (unreachable)
+41 end (none)
+42 break (unreachable)
+43 end (none)
+44 break (unreachable)
+45 end (none)
+46 block
+47 loop
+48 break (unreachable)
+49 end (none)
+50 unreachable (unreachable)
+51 end (none)
+52 end (none)
+53 loop
+54 break (unreachable)
+55 end (none)
+56 unreachable (unreachable)
+57 end (none)
+58 nop (none)
+59 end (none)
+60 const (i32)
+61 end (i32)
+
+$blocker:
+0 block
+1 break (unreachable)
+2 end (none)
+
+$frem:
+0 const (f64)
+1 const (f64)
+2 call_import (f64)
+
+$big_uint_div_u:
+0 const (i32)
+1 const (i32)
+2 binary (i32)
+3 const (i32)
+4 binary (i32)
+
+$fr:
+0 get_local (f64)
+1 unary (f32)
+2 drop (none)
+3 get_local (f32)
+4 drop (none)
+5 const (f32)
+6 drop (none)
+7 const (f32)
+8 drop (none)
+9 const (f32)
+10 drop (none)
+11 const (f32)
+12 drop (none)
+
+$negZero:
+0 const (f64)
+
+$abs:
+0 const (i32)
+1 set_local (none)
+2 const (i32)
+3 get_local (i32)
+4 binary (i32)
+5 get_local (i32)
+6 get_local (i32)
+7 const (i32)
+8 binary (i32)
+9 select (i32)
+10 set_local (none)
+11 const (f64)
+12 unary (f64)
+13 set_local (none)
+14 const (f32)
+15 unary (f32)
+16 set_local (none)
+
+$neg:
+0 get_local (f32)
+1 unary (f32)
+2 const (i32)
+3 const (i32)
+4 binary (i32)
+5 const (i32)
+6 binary (i32)
+7 call_indirect (none)
+
+$cneg:
+0 get_local (f32)
+1 const (i32)
+2 const (i32)
+3 binary (i32)
+4 const (i32)
+5 binary (i32)
+6 call_indirect (none)
+
+$___syscall_ret:
+0 get_local (i32)
+1 const (i32)
+2 binary (i32)
+3 const (i32)
+4 binary (i32)
+5 drop (none)
+
+$z:
+0 nop (none)
+
+$w:
+0 nop (none)
+
+$block_and_after:
+0 block
+1 const (i32)
+2 drop (none)
+3 break (unreachable)
+4 end (none)
+5 const (i32)
+
+$loop-roundtrip:
+0 loop
+1 get_local (f64)
+2 drop (none)
+3 get_local (f64)
+4 end (f64)
+
+$big-i64:
+0 const (i64)
+
+$i64-store32:
+0 get_local (i32)
+1 get_local (i64)
+2 store (none)
+
+$return-unreachable:
+0 const (i32)
+1 return (unreachable)
+
+$unreachable-block:
+0 const (i32)
+1 drop (none)
+2 const (i32)
+3 return (unreachable)
+
+$unreachable-block-toplevel:
+0 const (i32)
+1 drop (none)
+2 const (i32)
+3 return (unreachable)
+
+$unreachable-block0:
+0 const (i32)
+1 return (unreachable)
+
+$unreachable-block0-toplevel:
+0 const (i32)
+1 return (unreachable)
+
+$unreachable-block-with-br:
+0 block
+1 const (i32)
+2 drop (none)
+3 break (unreachable)
+4 end (none)
+5 const (i32)
+
+$unreachable-if:
+0 const (i32)
+1 if
+2 const (i32)
+3 return (unreachable)
+4 else
+5 const (i32)
+6 return (unreachable)
+7 end (none)
+8 unreachable (unreachable)
+
+$unreachable-if-toplevel:
+0 const (i32)
+1 if
+2 const (i32)
+3 return (unreachable)
+4 else
+5 const (i32)
+6 return (unreachable)
+7 end (none)
+8 unreachable (unreachable)
+
+$unreachable-loop:
+0 loop
+1 nop (none)
+2 const (i32)
+3 return (unreachable)
+4 end (none)
+5 unreachable (unreachable)
+
+$unreachable-loop0:
+0 loop
+1 const (i32)
+2 return (unreachable)
+3 end (none)
+4 unreachable (unreachable)
+
+$unreachable-loop-toplevel:
+0 loop
+1 nop (none)
+2 const (i32)
+3 return (unreachable)
+4 end (none)
+5 unreachable (unreachable)
+
+$unreachable-loop0-toplevel:
+0 loop
+1 const (i32)
+2 return (unreachable)
+3 end (none)
+4 unreachable (unreachable)
+
+$unreachable-ifs:
+0 unreachable (unreachable)
+
+$unreachable-if-arm:
+0 const (i32)
+1 if
+2 nop (none)
+3 else
+4 unreachable (unreachable)
+5 end (none)
+
+$local-to-stack:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+
+$local-to-stack-1:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 unary (i32)
+
+$local-to-stack-1b:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 const (i32)
+6 binary (i32)
+
+$local-to-stack-1c-no:
+0 const (i32)
+1 call (i32)
+2 set_local (none)
+3 const (i32)
+4 call (i32)
+5 drop (none)
+6 const (i32)
+7 get_local (i32)
+8 binary (i32)
+
+$local-to-stack-2-no:
+0 const (i32)
+1 call (i32)
+2 set_local (none)
+3 const (i32)
+4 call (i32)
+5 drop (none)
+6 get_local (i32)
+7 get_local (i32)
+8 binary (i32)
+
+$local-to-stack-3-no:
+0 const (i32)
+1 if
+2 const (i32)
+3 call (i32)
+4 set_local (none)
+5 else
+6 const (i32)
+7 call (i32)
+8 set_local (none)
+9 end (none)
+10 const (i32)
+11 call (i32)
+12 drop (none)
+13 get_local (i32)
+
+$local-to-stack-multi-4:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 drop (none)
+6 const (i32)
+7 call (i32)
+8 const (i32)
+9 call (i32)
+10 drop (none)
+
+$local-to-stack-multi-5:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 drop (none)
+6 const (i32)
+7 call (i32)
+8 const (i32)
+9 call (i32)
+10 drop (none)
+
+$local-to-stack-multi-6-justone:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 drop (none)
+6 const (i32)
+7 call (i32)
+8 set_local (none)
+9 const (i32)
+10 call (i32)
+11 drop (none)
+12 get_local (i32)
+13 get_local (i32)
+14 binary (i32)
+
+$local-to-stack-multi-7-justone:
+0 const (i32)
+1 call (i32)
+2 set_local (none)
+3 const (i32)
+4 call (i32)
+5 drop (none)
+6 get_local (i32)
+7 get_local (i32)
+8 binary (i32)
+9 drop (none)
+10 const (i32)
+11 call (i32)
+12 const (i32)
+13 call (i32)
+14 drop (none)
+
+$local-to-stack-overlapping-multi-8-no:
+0 const (i32)
+1 call (i32)
+2 set_local (none)
+3 const (i32)
+4 call (i32)
+5 const (i32)
+6 call (i32)
+7 drop (none)
+8 get_local (i32)
+9 binary (i32)
+
+$local-to-stack-overlapping-multi-9-yes:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 const (i32)
+5 call (i32)
+6 drop (none)
+7 binary (i32)
+
+$local-to-stack-through-control-flow:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 const (i32)
+5 if
+6 nop (none)
+7 end (none)
+8 drop (none)
+9 const (i32)
+10 call (i32)
+11 block
+12 break (unreachable)
+13 end (none)
+14 drop (none)
+15 drop (none)
+
+$local-to-stack-in-control-flow:
+0 const (i32)
+1 if
+2 const (i32)
+3 call (i32)
+4 drop (none)
+5 else
+6 const (i32)
+7 call (i32)
+8 drop (none)
+9 end (none)
+
+$remove-block:
+0 const (i32)
+1 call (i32)
+2 const (i32)
+3 call (i32)
+4 const (i32)
+5 call (i32)
+6 drop (none)
+7 unary (i32)
+8 binary (i32)
+
+(module
+ (type $FUNCSIG$vf (func (param f32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$id (func (param f64) (result i32)))
+ (type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
+ (type $4 (func (result f64)))
+ (type $5 (func (result i32)))
+ (type $6 (func (param i32) (result i32)))
+ (type $7 (func (param f64) (result f64)))
+ (type $8 (func (result i64)))
+ (type $9 (func (param i32 i64)))
+ (import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi))
+ (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
+ (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
+ (table 10 anyfunc)
+ (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
+ (memory $0 4096 4096)
+ (data (i32.const 1026) "\14\00")
+ (export "big_negative" (func $big_negative))
+ (func $big_negative (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $temp f64)
+ (block $block0
+ (set_local $temp
+ (f64.const -2147483648)
+ )
+ (set_local $temp
+ (f64.const -2147483648)
+ )
+ (set_local $temp
+ (f64.const -21474836480)
+ )
+ (set_local $temp
+ (f64.const 0.039625)
+ )
+ (set_local $temp
+ (f64.const -0.039625)
+ )
+ )
+ )
+ (func $importedDoubles (; 4 ;) (; has Stack IR ;) (type $4) (result f64)
+ (local $temp f64)
+ (block $topmost (result f64)
+ (set_local $temp
+ (f64.add
+ (f64.add
+ (f64.add
+ (f64.load
+ (i32.const 8)
+ )
+ (f64.load
+ (i32.const 16)
+ )
+ )
+ (f64.neg
+ (f64.load
+ (i32.const 16)
+ )
+ )
+ )
+ (f64.neg
+ (f64.load
+ (i32.const 8)
+ )
+ )
+ )
+ )
+ (if
+ (i32.gt_s
+ (i32.load
+ (i32.const 24)
+ )
+ (i32.const 0)
+ )
+ (br $topmost
+ (f64.const -3.4)
+ )
+ )
+ (if
+ (f64.gt
+ (f64.load
+ (i32.const 32)
+ )
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const 5.6)
+ )
+ )
+ (f64.const 1.2)
+ )
+ )
+ (func $doubleCompares (; 5 ;) (; has Stack IR ;) (type $FUNCSIG$ddd) (param $x f64) (param $y f64) (result f64)
+ (local $t f64)
+ (local $Int f64)
+ (local $Double i32)
+ (block $topmost (result f64)
+ (if
+ (f64.gt
+ (get_local $x)
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const 1.2)
+ )
+ )
+ (if
+ (f64.gt
+ (get_local $Int)
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const -3.4)
+ )
+ )
+ (if
+ (i32.gt_s
+ (get_local $Double)
+ (i32.const 0)
+ )
+ (br $topmost
+ (f64.const 5.6)
+ )
+ )
+ (if
+ (f64.lt
+ (get_local $x)
+ (get_local $y)
+ )
+ (br $topmost
+ (get_local $x)
+ )
+ )
+ (get_local $y)
+ )
+ )
+ (func $intOps (; 6 ;) (; has Stack IR ;) (type $5) (result i32)
+ (local $x i32)
+ (i32.eq
+ (get_local $x)
+ (i32.const 0)
+ )
+ )
+ (func $hexLiterals (; 7 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (drop
+ (i32.add
+ (i32.add
+ (i32.const 0)
+ (i32.const 313249263)
+ )
+ (i32.const -19088752)
+ )
+ )
+ )
+ (func $conversions (; 8 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $i i32)
+ (local $d f64)
+ (block $block0
+ (set_local $i
+ (call $f64-to-int
+ (get_local $d)
+ )
+ )
+ (set_local $d
+ (f64.convert_s/i32
+ (get_local $i)
+ )
+ )
+ (set_local $d
+ (f64.convert_u/i32
+ (i32.shr_u
+ (get_local $i)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ )
+ (func $seq (; 9 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $J f64)
+ (set_local $J
+ (f64.sub
+ (block $block0 (result f64)
+ (drop
+ (f64.const 0.1)
+ )
+ (f64.const 5.1)
+ )
+ (block $block1 (result f64)
+ (drop
+ (f64.const 3.2)
+ )
+ (f64.const 4.2)
+ )
+ )
+ )
+ )
+ (func $switcher (; 10 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (block $topmost (result i32)
+ (block $switch$0
+ (block $switch-default$3
+ (block $switch-case$2
+ (block $switch-case$1
+ (br_table $switch-case$1 $switch-case$2 $switch-default$3
+ (i32.sub
+ (get_local $x)
+ (i32.const 1)
+ )
+ )
+ )
+ (br $topmost
+ (i32.const 1)
+ )
+ )
+ (br $topmost
+ (i32.const 2)
+ )
+ )
+ (nop)
+ )
+ (block $switch$4
+ (block $switch-default$7
+ (block $switch-case$6
+ (block $switch-case$5
+ (br_table $switch-case$6 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-case$5 $switch-default$7
+ (i32.sub
+ (get_local $x)
+ (i32.const 5)
+ )
+ )
+ )
+ (br $topmost
+ (i32.const 121)
+ )
+ )
+ (br $topmost
+ (i32.const 51)
+ )
+ )
+ (nop)
+ )
+ (block $label$break$Lout
+ (block $switch-default$16
+ (block $switch-case$15
+ (block $switch-case$12
+ (block $switch-case$9
+ (block $switch-case$8
+ (br_table $switch-case$15 $switch-default$16 $switch-default$16 $switch-case$12 $switch-default$16 $switch-default$16 $switch-default$16 $switch-default$16 $switch-case$9 $switch-default$16 $switch-case$8 $switch-default$16
+ (i32.sub
+ (get_local $x)
+ (i32.const 2)
+ )
+ )
+ )
+ (br $label$break$Lout)
+ )
+ (br $label$break$Lout)
+ )
+ (block $while-out$10
+ (loop $while-in$11
+ (block $block1
+ (br $while-out$10)
+ (br $while-in$11)
+ )
+ )
+ (br $label$break$Lout)
+ )
+ )
+ (block $while-out$13
+ (loop $while-in$14
+ (block $block3
+ (br $label$break$Lout)
+ (br $while-in$14)
+ )
+ )
+ (br $label$break$Lout)
+ )
+ )
+ (nop)
+ )
+ (i32.const 0)
+ )
+ )
+ (func $blocker (; 11 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (block $label$break$L
+ (br $label$break$L)
+ )
+ )
+ (func $frem (; 12 ;) (; has Stack IR ;) (type $4) (result f64)
+ (call $f64-rem
+ (f64.const 5.5)
+ (f64.const 1.2)
+ )
+ )
+ (func $big_uint_div_u (; 13 ;) (; has Stack IR ;) (type $5) (result i32)
+ (local $x i32)
+ (block $topmost (result i32)
+ (set_local $x
+ (i32.and
+ (i32.div_u
+ (i32.const -1)
+ (i32.const 2)
+ )
+ (i32.const -1)
+ )
+ )
+ (get_local $x)
+ )
+ )
+ (func $fr (; 14 ;) (; has Stack IR ;) (type $FUNCSIG$vf) (param $x f32)
+ (local $y f32)
+ (local $z f64)
+ (block $block0
+ (drop
+ (f32.demote/f64
+ (get_local $z)
+ )
+ )
+ (drop
+ (get_local $y)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
+ )
+ )
+ )
+ (func $negZero (; 15 ;) (; has Stack IR ;) (type $4) (result f64)
+ (f64.const -0)
+ )
+ (func $abs (; 16 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $x i32)
+ (local $y f64)
+ (local $z f32)
+ (local $asm2wasm_i32_temp i32)
+ (block $block0
+ (set_local $x
+ (block $block1 (result i32)
+ (set_local $asm2wasm_i32_temp
+ (i32.const 0)
+ )
+ (select
+ (i32.sub
+ (i32.const 0)
+ (get_local $asm2wasm_i32_temp)
+ )
+ (get_local $asm2wasm_i32_temp)
+ (i32.lt_s
+ (get_local $asm2wasm_i32_temp)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ (set_local $y
+ (f64.abs
+ (f64.const 0)
+ )
+ )
+ (set_local $z
+ (f32.abs
+ (f32.const 0)
+ )
+ )
+ )
+ )
+ (func $neg (; 17 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $x f32)
+ (block $block0
+ (set_local $x
+ (f32.neg
+ (get_local $x)
+ )
+ )
+ (call_indirect (type $FUNCSIG$vf)
+ (get_local $x)
+ (i32.add
+ (i32.and
+ (i32.const 1)
+ (i32.const 7)
+ )
+ (i32.const 8)
+ )
+ )
+ )
+ )
+ (func $cneg (; 18 ;) (; has Stack IR ;) (type $FUNCSIG$vf) (param $x f32)
+ (call_indirect (type $FUNCSIG$vf)
+ (get_local $x)
+ (i32.add
+ (i32.and
+ (i32.const 1)
+ (i32.const 7)
+ )
+ (i32.const 8)
+ )
+ )
+ )
+ (func $___syscall_ret (; 19 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $$0 i32)
+ (drop
+ (i32.gt_u
+ (i32.shr_u
+ (get_local $$0)
+ (i32.const 0)
+ )
+ (i32.const -4096)
+ )
+ )
+ )
+ (func $z (; 20 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $w (; 21 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $block_and_after (; 22 ;) (; has Stack IR ;) (type $5) (result i32)
+ (block $waka
+ (drop
+ (i32.const 1)
+ )
+ (br $waka)
+ )
+ (i32.const 0)
+ )
+ (func $loop-roundtrip (; 23 ;) (; has Stack IR ;) (type $7) (param $0 f64) (result f64)
+ (loop $loop-in1 (result f64)
+ (drop
+ (get_local $0)
+ )
+ (get_local $0)
+ )
+ )
+ (func $big-i64 (; 24 ;) (; has Stack IR ;) (type $8) (result i64)
+ (i64.const -9218868437227405313)
+ )
+ (func $i64-store32 (; 25 ;) (; has Stack IR ;) (type $9) (param $0 i32) (param $1 i64)
+ (i64.store32
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ (func $return-unreachable (; 26 ;) (; has Stack IR ;) (type $5) (result i32)
+ (return
+ (i32.const 1)
+ )
+ )
+ (func $unreachable-block (; 27 ;) (; has Stack IR ;) (type $5) (result i32)
+ (f64.abs
+ (block $block
+ (drop
+ (i32.const 1)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ )
+ )
+ (func $unreachable-block-toplevel (; 28 ;) (; has Stack IR ;) (type $5) (result i32)
+ (block $block
+ (drop
+ (i32.const 1)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ )
+ (func $unreachable-block0 (; 29 ;) (; has Stack IR ;) (type $5) (result i32)
+ (f64.abs
+ (block $block
+ (return
+ (i32.const 2)
+ )
+ )
+ )
+ )
+ (func $unreachable-block0-toplevel (; 30 ;) (; has Stack IR ;) (type $5) (result i32)
+ (block $block
+ (return
+ (i32.const 2)
+ )
+ )
+ )
+ (func $unreachable-block-with-br (; 31 ;) (; has Stack IR ;) (type $5) (result i32)
+ (block $block
+ (drop
+ (i32.const 1)
+ )
+ (br $block)
+ )
+ (i32.const 1)
+ )
+ (func $unreachable-if (; 32 ;) (; has Stack IR ;) (type $5) (result i32)
+ (f64.abs
+ (if
+ (i32.const 3)
+ (return
+ (i32.const 2)
+ )
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ (func $unreachable-if-toplevel (; 33 ;) (; has Stack IR ;) (type $5) (result i32)
+ (if
+ (i32.const 3)
+ (return
+ (i32.const 2)
+ )
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ (func $unreachable-loop (; 34 ;) (; has Stack IR ;) (type $5) (result i32)
+ (f64.abs
+ (loop $loop-in
+ (nop)
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ (func $unreachable-loop0 (; 35 ;) (; has Stack IR ;) (type $5) (result i32)
+ (f64.abs
+ (loop $loop-in
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ (func $unreachable-loop-toplevel (; 36 ;) (; has Stack IR ;) (type $5) (result i32)
+ (loop $loop-in
+ (nop)
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ (func $unreachable-loop0-toplevel (; 37 ;) (; has Stack IR ;) (type $5) (result i32)
+ (loop $loop-in
+ (return
+ (i32.const 1)
+ )
+ )
+ )
+ (func $unreachable-ifs (; 38 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (if
+ (unreachable)
+ (nop)
+ )
+ (if
+ (unreachable)
+ (unreachable)
+ )
+ (if
+ (unreachable)
+ (nop)
+ (nop)
+ )
+ (if
+ (unreachable)
+ (unreachable)
+ (nop)
+ )
+ (if
+ (unreachable)
+ (nop)
+ (unreachable)
+ )
+ (if
+ (unreachable)
+ (unreachable)
+ (unreachable)
+ )
+ (if
+ (i32.const 1)
+ (unreachable)
+ (nop)
+ )
+ (if
+ (i32.const 1)
+ (nop)
+ (unreachable)
+ )
+ (if
+ (i32.const 1)
+ (unreachable)
+ (unreachable)
+ )
+ )
+ (func $unreachable-if-arm (; 39 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (if
+ (i32.const 1)
+ (block $block
+ (nop)
+ )
+ (block $block12
+ (unreachable)
+ (drop
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ (func $local-to-stack (; 40 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ (get_local $temp)
+ )
+ (func $local-to-stack-1 (; 41 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ (i32.eqz
+ (get_local $temp)
+ )
+ )
+ (func $local-to-stack-1b (; 42 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ (i32.add
+ (get_local $temp)
+ (i32.const 3)
+ )
+ )
+ (func $local-to-stack-1c-no (; 43 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ (i32.add
+ (i32.const 3)
+ (get_local $temp)
+ )
+ )
+ (func $local-to-stack-2-no (; 44 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ (i32.add
+ (get_local $temp)
+ (get_local $temp)
+ )
+ )
+ (func $local-to-stack-3-no (; 45 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (if
+ (i32.const 1)
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 1)
+ )
+ )
+ (set_local $temp
+ (call $local-to-stack
+ (i32.const 2)
+ )
+ )
+ )
+ (drop
+ (call $local-to-stack
+ (i32.const 3)
+ )
+ )
+ (get_local $temp)
+ )
+ (func $local-to-stack-multi-4 (; 46 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 2)
+ )
+ )
+ (drop
+ (get_local $temp1)
+ )
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 4)
+ )
+ )
+ (get_local $temp1)
+ )
+ (func $local-to-stack-multi-5 (; 47 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 2)
+ )
+ )
+ (drop
+ (get_local $temp1)
+ )
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 4)
+ )
+ )
+ (get_local $temp2)
+ )
+ (func $local-to-stack-multi-6-justone (; 48 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 2)
+ )
+ )
+ (drop
+ (get_local $temp1)
+ )
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 4)
+ )
+ )
+ (i32.add
+ (get_local $temp2)
+ (get_local $temp2)
+ )
+ )
+ (func $local-to-stack-multi-7-justone (; 49 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 2)
+ )
+ )
+ (drop
+ (i32.add
+ (get_local $temp1)
+ (get_local $temp1)
+ )
+ )
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 4)
+ )
+ )
+ (get_local $temp2)
+ )
+ (func $local-to-stack-overlapping-multi-8-no (; 50 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (i32.add
+ (get_local $temp2)
+ (get_local $temp1)
+ )
+ )
+ (func $local-to-stack-overlapping-multi-9-yes (; 51 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $local-to-stack-multi-4
+ (i32.const 3)
+ )
+ )
+ (i32.add
+ (get_local $temp1)
+ (get_local $temp2)
+ )
+ )
+ (func $local-to-stack-through-control-flow (; 52 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp2
+ (call $local-to-stack-multi-4
+ (i32.const 0)
+ )
+ )
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (if
+ (i32.const 0)
+ (nop)
+ )
+ (drop
+ (get_local $temp1)
+ )
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 2)
+ )
+ )
+ (block $block
+ (br $block)
+ )
+ (drop
+ (get_local $temp1)
+ )
+ (drop
+ (get_local $temp2)
+ )
+ )
+ (func $local-to-stack-in-control-flow (; 53 ;) (; has Stack IR ;) (type $FUNCSIG$v)
+ (local $temp1 i32)
+ (if
+ (i32.const 0)
+ (block $block
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 0)
+ )
+ )
+ (drop
+ (get_local $temp1)
+ )
+ )
+ (block $block13
+ (set_local $temp1
+ (call $local-to-stack-multi-4
+ (i32.const 1)
+ )
+ )
+ (drop
+ (get_local $temp1)
+ )
+ )
+ )
+ )
+ (func $remove-block (; 54 ;) (; has Stack IR ;) (type $6) (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $remove-block
+ (i32.const 0)
+ )
+ (i32.eqz
+ (block $block (result i32)
+ (set_local $temp
+ (call $remove-block
+ (i32.const 1)
+ )
+ )
+ (drop
+ (call $remove-block
+ (i32.const 2)
+ )
+ )
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.wast b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.wast
new file mode 100644
index 000000000..9176ff5bc
--- /dev/null
+++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_optimize-level=3.wast
@@ -0,0 +1,712 @@
+(module
+ (type $FUNCSIG$vf (func (param f32)))
+ (type $FUNCSIG$v (func))
+ (type $FUNCSIG$id (func (param f64) (result i32)))
+ (type $FUNCSIG$ddd (func (param f64 f64) (result f64)))
+ (type $4 (func (result f64)))
+ (type $5 (func (result i32)))
+ (type $6 (func (param i32) (result i32)))
+ (type $7 (func (param f64) (result f64)))
+ (type $8 (func (result i64)))
+ (type $9 (func (param i32 i64)))
+ (import "env" "_emscripten_asm_const_vi" (func $_emscripten_asm_const_vi))
+ (import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
+ (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64)))
+ (table 10 anyfunc)
+ (elem (i32.const 0) $z $big_negative $z $z $w $w $importedDoubles $w $z $cneg)
+ (memory $0 4096 4096)
+ (data (i32.const 1026) "\14\00")
+ (export "big_negative" (func $big_negative))
+ (func $big_negative (type $FUNCSIG$v)
+ (local $temp f64)
+ (block $block0
+ (set_local $temp
+ (f64.const -2147483648)
+ )
+ (set_local $temp
+ (f64.const -2147483648)
+ )
+ (set_local $temp
+ (f64.const -21474836480)
+ )
+ (set_local $temp
+ (f64.const 0.039625)
+ )
+ (set_local $temp
+ (f64.const -0.039625)
+ )
+ )
+ )
+ (func $importedDoubles (type $4) (result f64)
+ (local $temp f64)
+ (block $topmost (result f64)
+ (set_local $temp
+ (f64.add
+ (f64.add
+ (f64.add
+ (f64.load
+ (i32.const 8)
+ )
+ (f64.load
+ (i32.const 16)
+ )
+ )
+ (f64.neg
+ (f64.load
+ (i32.const 16)
+ )
+ )
+ )
+ (f64.neg
+ (f64.load
+ (i32.const 8)
+ )
+ )
+ )
+ )
+ (if
+ (i32.gt_s
+ (i32.load
+ (i32.const 24)
+ )
+ (i32.const 0)
+ )
+ (br $topmost
+ (f64.const -3.4)
+ )
+ )
+ (if
+ (f64.gt
+ (f64.load
+ (i32.const 32)
+ )
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const 5.6)
+ )
+ )
+ (f64.const 1.2)
+ )
+ )
+ (func $doubleCompares (type $FUNCSIG$ddd) (param $x f64) (param $y f64) (result f64)
+ (local $t f64)
+ (local $Int f64)
+ (local $Double i32)
+ (block $topmost (result f64)
+ (if
+ (f64.gt
+ (get_local $x)
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const 1.2)
+ )
+ )
+ (if
+ (f64.gt
+ (get_local $Int)
+ (f64.const 0)
+ )
+ (br $topmost
+ (f64.const -3.4)
+ )
+ )
+ (if
+ (i32.gt_s
+ (get_local $Double)
+ (i32.const 0)
+ )
+ (br $topmost
+ (f64.const 5.6)
+ )
+ )
+ (if
+ (f64.lt
+ (get_local $x)
+ (get_local $y)
+ )
+ (br $topmost
+ (get_local $x)
+ )
+ )
+ (get_local $y)
+ )
+ )
+ (func $intOps (type $5) (result i32)
+ (local $x i32)
+ (i32.eq
+ (get_local $x)
+ (i32.const 0)
+ )
+ )
+ (func $hexLiterals (type $FUNCSIG$v)
+ (drop
+ (i32.add
+ (i32.add
+ (i32.const 0)
+ (i32.const 313249263)
+ )
+ (i32.const -19088752)
+ )
+ )
+ )
+ (func $conversions (type $FUNCSIG$v)
+ (local $i i32)
+ (local $d f64)
+ (block $block0
+ (set_local $i
+ (call $f64-to-int
+ (get_local $d)
+ )
+ )
+ (set_local $d
+ (f64.convert_s/i32
+ (get_local $i)
+ )
+ )
+ (set_local $d
+ (f64.convert_u/i32
+ (i32.shr_u
+ (get_local $i)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ )
+ (func $seq (type $FUNCSIG$v)
+ (local $J f64)
+ (set_local $J
+ (f64.sub
+ (block $block0 (result f64)
+ (drop
+ (f64.const 0.1)
+ )
+ (f64.const 5.1)
+ )
+ (block $block1 (result f64)
+ (drop
+ (f64.const 3.2)
+ )
+ (f64.const 4.2)
+ )
+ )
+ )
+ )
+ (func $switcher (type $6) (param $x i32) (result i32)
+ (block $topmost (result i32)
+ (block $switch$0
+ (block $switch-default$3
+ (block $switch-case$2
+ (block $switch-case$1
+ (br_table $switch-case$1 $switch-case$2 $switch-default$3
+ (i32.sub
+ (get_local $x)
+ (i32.const 1)
+ )
+ )
+ )
+ (br $topmost
+ (i32.const 1)
+ )
+ )
+ (br $topmost
+ (i32.const 2)
+ )
+ )
+ (nop)
+ )
+ (block $switch$4
+ (block $switch-default$7
+ (block $switch-case$6
+ (block $switch-case$5
+ (br_table $switch-case$6 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-default$7 $switch-case$5 $switch-default$7
+ (i32.sub
+ (get_local $x)
+ (i32.const 5)
+ )
+ )
+ )
+ (br $topmost
+ (i32.const 121)
+ )
+ )
+ (br $topmost
+ (i32.const 51)
+ )
+ )
+ (nop)
+ )
+ (block $label$break$Lout
+ (block $switch-default$16
+ (block $switch-case$15
+ (block $switch-case$12
+ (block $switch-case$9
+ (block $switch-case$8
+ (br_table $switch-case$15 $switch-default$16 $switch-default$16 $switch-case$12 $switch-default$16 $switch-default$16 $switch-default$16 $switch-default$16 $switch-case$9 $switch-default$16 $switch-case$8 $switch-default$16
+ (i32.sub
+ (get_local $x)
+ (i32.const 2)
+ )
+ )
+ )
+ (br $label$break$Lout)
+ )
+ (br $label$break$Lout)
+ )
+ (block $while-out$10
+ (loop $while-in$11
+ (block $block1
+ (br $while-out$10)
+ (br $while-in$11)
+ )
+ )
+ (br $label$break$Lout)
+ )
+ )
+ (block $while-out$13
+ (loop $while-in$14
+ (block $block3
+ (br $label$break$Lout)
+ (br $while-in$14)
+ )
+ )
+ (br $label$break$Lout)
+ )
+ )
+ (nop)
+ )
+ (i32.const 0)
+ )
+ )
+ (func $blocker (type $FUNCSIG$v)
+ (block $label$break$L
+ (br $label$break$L)
+ )
+ )
+ (func $frem (type $4) (result f64)
+ (call $f64-rem
+ (f64.const 5.5)
+ (f64.const 1.2)
+ )
+ )
+ (func $big_uint_div_u (type $5) (result i32)
+ (local $x i32)
+ (block $topmost (result i32)
+ (set_local $x
+ (i32.and
+ (i32.div_u
+ (i32.const -1)
+ (i32.const 2)
+ )
+ (i32.const -1)
+ )
+ )
+ (get_local $x)
+ )
+ )
+ (func $fr (type $FUNCSIG$vf) (param $x f32)
+ (local $y f32)
+ (local $z f64)
+ (block $block0
+ (drop
+ (f32.demote/f64
+ (get_local $z)
+ )
+ )
+ (drop
+ (get_local $y)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
+ )
+ (drop
+ (f32.const 5)
+ )
+ (drop
+ (f32.const 0)
+ )
+ )
+ )
+ (func $negZero (type $4) (result f64)
+ (f64.const -0)
+ )
+ (func $abs (type $FUNCSIG$v)
+ (local $x i32)
+ (local $y f64)
+ (local $z f32)
+ (local $asm2wasm_i32_temp i32)
+ (block $block0
+ (set_local $x
+ (block $block1 (result i32)
+ (set_local $asm2wasm_i32_temp
+ (i32.const 0)
+ )
+ (select
+ (i32.sub
+ (i32.const 0)
+ (get_local $asm2wasm_i32_temp)
+ )
+ (get_local $asm2wasm_i32_temp)
+ (i32.lt_s
+ (get_local $asm2wasm_i32_temp)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ (set_local $y
+ (f64.abs
+ (f64.const 0)
+ )
+ )
+ (set_local $z
+ (f32.abs
+ (f32.const 0)
+ )
+ )
+ )
+ )
+ (func $neg (type $FUNCSIG$v)
+ (local $x f32)
+ (block $block0
+ (set_local $x
+ (f32.neg
+ (get_local $x)
+ )
+ )
+ (call_indirect (type $FUNCSIG$vf)
+ (get_local $x)
+ (i32.add
+ (i32.and
+ (i32.const 1)
+ (i32.const 7)
+ )
+ (i32.const 8)
+ )
+ )
+ )
+ )
+ (func $cneg (type $FUNCSIG$vf) (param $x f32)
+ (call_indirect (type $FUNCSIG$vf)
+ (get_local $x)
+ (i32.add
+ (i32.and
+ (i32.const 1)
+ (i32.const 7)
+ )
+ (i32.const 8)
+ )
+ )
+ )
+ (func $___syscall_ret (type $FUNCSIG$v)
+ (local $$0 i32)
+ (drop
+ (i32.gt_u
+ (i32.shr_u
+ (get_local $$0)
+ (i32.const 0)
+ )
+ (i32.const -4096)
+ )
+ )
+ )
+ (func $z (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $w (type $FUNCSIG$v)
+ (nop)
+ )
+ (func $block_and_after (type $5) (result i32)
+ (block $waka
+ (drop
+ (i32.const 1)
+ )
+ (br $waka)
+ )
+ (i32.const 0)
+ )
+ (func $loop-roundtrip (type $7) (param $0 f64) (result f64)
+ (loop $loop-in1 (result f64)
+ (drop
+ (get_local $0)
+ )
+ (get_local $0)
+ )
+ )
+ (func $big-i64 (type $8) (result i64)
+ (i64.const -9218868437227405313)
+ )
+ (func $i64-store32 (type $9) (param $0 i32) (param $1 i64)
+ (i64.store32
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ (func $return-unreachable (result i32)
+ (return (i32.const 1))
+ )
+ (func $unreachable-block (result i32)
+ (f64.abs
+ (block ;; note no type - valid in binaryen IR, in wasm must be i32
+ (drop (i32.const 1))
+ (return (i32.const 2))
+ )
+ )
+ )
+ (func $unreachable-block-toplevel (result i32)
+ (block ;; note no type - valid in binaryen IR, in wasm must be i32
+ (drop (i32.const 1))
+ (return (i32.const 2))
+ )
+ )
+ (func $unreachable-block0 (result i32)
+ (f64.abs
+ (block ;; note no type - valid in binaryen IR, in wasm must be i32
+ (return (i32.const 2))
+ )
+ )
+ )
+ (func $unreachable-block0-toplevel (result i32)
+ (block ;; note no type - valid in binaryen IR, in wasm must be i32
+ (return (i32.const 2))
+ )
+ )
+ (func $unreachable-block-with-br (result i32)
+ (block $block ;; unreachable type due to last element having that type, but the block is exitable
+ (drop (i32.const 1))
+ (br $block)
+ )
+ (i32.const 1)
+ )
+ (func $unreachable-if (result i32)
+ (f64.abs
+ (if ;; note no type - valid in binaryen IR, in wasm must be i32
+ (i32.const 3)
+ (return (i32.const 2))
+ (return (i32.const 1))
+ )
+ )
+ )
+ (func $unreachable-if-toplevel (result i32)
+ (if ;; note no type - valid in binaryen IR, in wasm must be i32
+ (i32.const 3)
+ (return (i32.const 2))
+ (return (i32.const 1))
+ )
+ )
+ (func $unreachable-loop (result i32)
+ (f64.abs
+ (loop ;; note no type - valid in binaryen IR, in wasm must be i32
+ (nop)
+ (return (i32.const 1))
+ )
+ )
+ )
+ (func $unreachable-loop0 (result i32)
+ (f64.abs
+ (loop ;; note no type - valid in binaryen IR, in wasm must be i32
+ (return (i32.const 1))
+ )
+ )
+ )
+ (func $unreachable-loop-toplevel (result i32)
+ (loop ;; note no type - valid in binaryen IR, in wasm must be i32
+ (nop)
+ (return (i32.const 1))
+ )
+ )
+ (func $unreachable-loop0-toplevel (result i32)
+ (loop ;; note no type - valid in binaryen IR, in wasm must be i32
+ (return (i32.const 1))
+ )
+ )
+ (func $unreachable-ifs
+ (if (unreachable) (nop))
+ (if (unreachable) (unreachable))
+ (if (unreachable) (nop) (nop))
+ (if (unreachable) (unreachable) (nop))
+ (if (unreachable) (nop) (unreachable))
+ (if (unreachable) (unreachable) (unreachable))
+ ;;
+ (if (i32.const 1) (unreachable) (nop))
+ (if (i32.const 1) (nop) (unreachable))
+ (if (i32.const 1) (unreachable) (unreachable))
+ )
+ (func $unreachable-if-arm
+ (if
+ (i32.const 1)
+ (block
+ (nop)
+ )
+ (block
+ (unreachable)
+ (drop
+ (i32.const 1)
+ )
+ )
+ )
+ )
+ (func $local-to-stack (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp (call $local-to-stack (i32.const 1))) ;; this set could just be on the stack
+ (drop (call $local-to-stack (i32.const 2)))
+ (get_local $temp)
+ )
+ (func $local-to-stack-1 (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp (call $local-to-stack (i32.const 1)))
+ (drop (call $local-to-stack (i32.const 2)))
+ (i32.eqz
+ (get_local $temp)
+ )
+ )
+ (func $local-to-stack-1b (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp (call $local-to-stack (i32.const 1)))
+ (drop (call $local-to-stack (i32.const 2)))
+ (i32.add
+ (get_local $temp)
+ (i32.const 3)
+ )
+ )
+ (func $local-to-stack-1c-no (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp (call $local-to-stack (i32.const 1)))
+ (drop (call $local-to-stack (i32.const 2)))
+ (i32.add
+ (i32.const 3) ;; this is in the way
+ (get_local $temp)
+ )
+ )
+ (func $local-to-stack-2-no (param $x i32) (result i32)
+ (local $temp i32)
+ (set_local $temp (call $local-to-stack (i32.const 1)))
+ (drop (call $local-to-stack (i32.const 2)))
+ (i32.add
+ (get_local $temp)
+ (get_local $temp) ;; a second use - so cannot stack it
+ )
+ )
+ (func $local-to-stack-3-no (param $x i32) (result i32)
+ (local $temp i32)
+ (if (i32.const 1)
+ (set_local $temp (call $local-to-stack (i32.const 1)))
+ (set_local $temp (call $local-to-stack (i32.const 2))) ;; two sets for that get
+ )
+ (drop (call $local-to-stack (i32.const 3)))
+ (get_local $temp)
+ )
+ (func $local-to-stack-multi-4 (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 2)))
+ (drop (get_local $temp1))
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 3))) ;; same local, used later
+ (drop (call $local-to-stack-multi-4 (i32.const 4)))
+ (get_local $temp1)
+ )
+ (func $local-to-stack-multi-5 (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 2)))
+ (drop (get_local $temp1))
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 3))) ;; different local, used later
+ (drop (call $local-to-stack-multi-4 (i32.const 4)))
+ (get_local $temp2)
+ )
+ (func $local-to-stack-multi-6-justone (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 2)))
+ (drop (get_local $temp1))
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 3))) ;; different local, used later
+ (drop (call $local-to-stack-multi-4 (i32.const 4)))
+ (i32.add
+ (get_local $temp2)
+ (get_local $temp2)
+ )
+ )
+ (func $local-to-stack-multi-7-justone (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 2)))
+ (drop
+ (i32.add
+ (get_local $temp1)
+ (get_local $temp1)
+ )
+ )
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 3))) ;; different local, used later
+ (drop (call $local-to-stack-multi-4 (i32.const 4)))
+ (get_local $temp2)
+ )
+ (func $local-to-stack-overlapping-multi-8-no (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 3)))
+ (i32.add
+ (get_local $temp2) ;; the timing
+ (get_local $temp1) ;; it sucks
+ )
+ )
+ (func $local-to-stack-overlapping-multi-9-yes (param $x i32) (result i32)
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (call $local-to-stack-multi-4 (i32.const 3)))
+ (i32.add
+ (get_local $temp1) ;; the stars align
+ (get_local $temp2) ;; and a time presents itself
+ )
+ )
+ (func $local-to-stack-through-control-flow
+ (local $temp1 i32)
+ (local $temp2 i32)
+ (set_local $temp2 (call $local-to-stack-multi-4 (i32.const 0)))
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (if (i32.const 0) (nop))
+ (drop (get_local $temp1))
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 2)))
+ (block $block (br $block))
+ (drop (get_local $temp1))
+ (drop (get_local $temp2))
+ )
+ (func $local-to-stack-in-control-flow
+ (local $temp1 i32)
+ (if (i32.const 0)
+ (block
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 0)))
+ (drop (get_local $temp1))
+ )
+ (block
+ (set_local $temp1 (call $local-to-stack-multi-4 (i32.const 1)))
+ (drop (get_local $temp1))
+ )
+ )
+ )
+ (func $remove-block (param $x i32) (result i32)
+ (local $temp i32)
+ (i32.add
+ (call $remove-block (i32.const 0))
+ (i32.eqz
+ (block (result i32) ;; after we use the stack instead of the local, we can remove this block
+ (set_local $temp (call $remove-block (i32.const 1)))
+ (drop (call $remove-block (i32.const 2)))
+ (get_local $temp)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt
new file mode 100644
index 000000000..126b2926e
--- /dev/null
+++ b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.txt
@@ -0,0 +1,41 @@
+$0:
+0 block
+1 block
+2 loop
+3 block
+4 unreachable (unreachable)
+5 unreachable (unreachable)
+6 end (none)
+7 unreachable (unreachable)
+8 set_local (unreachable)
+9 unreachable (unreachable)
+10 unreachable (unreachable)
+11 end (none)
+12 unreachable (unreachable)
+13 unreachable (unreachable)
+14 unreachable (unreachable)
+15 end (none)
+16 unreachable (unreachable)
+17 break (unreachable)
+18 unreachable (unreachable)
+19 end (none)
+
+(module
+ (type $0 (func (param i64)))
+ (func $0 (; 0 ;) (; has Stack IR ;) (type $0) (param $var$0 i64)
+ (block $label$1
+ (br_if $label$1
+ (block $label$2
+ (loop $label$3
+ (tee_local $var$0
+ (block $label$4
+ (unreachable)
+ )
+ )
+ )
+ (unreachable)
+ )
+ )
+ )
+ )
+)
diff --git a/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.wast b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.wast
new file mode 100644
index 000000000..6a771aa4d
--- /dev/null
+++ b/test/passes/remove-unused-brs_generate-stack-ir_print-stack-ir.wast
@@ -0,0 +1,21 @@
+(module
+ (type $0 (func (param i64)))
+ (func $0 (; 0 ;) (type $0) (param $var$0 i64)
+ (block $label$1
+ (br_if $label$1
+ (block $label$2 (result i32)
+ (loop $label$3
+ (set_local $var$0
+ (block $label$4 (result i64)
+ (unreachable)
+ )
+ )
+ )
+ (unreachable)
+ )
+ )
+ (nop)
+ )
+ )
+)
+
diff --git a/test/threads.fromasm b/test/threads.fromasm
index 4d191732c..2c1059dcc 100644
--- a/test/threads.fromasm
+++ b/test/threads.fromasm
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "threads.asm.js")
(export "test" (func $test))
- (func $test (; 0 ;)
+ (func $test (; 0 ;) (; has Stack IR ;)
(local $0 i32)
(drop
(i32.atomic.load
diff --git a/test/threads.fromasm.clamp b/test/threads.fromasm.clamp
index 4d191732c..2c1059dcc 100644
--- a/test/threads.fromasm.clamp
+++ b/test/threads.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "threads.asm.js")
(export "test" (func $test))
- (func $test (; 0 ;)
+ (func $test (; 0 ;) (; has Stack IR ;)
(local $0 i32)
(drop
(i32.atomic.load
diff --git a/test/threads.fromasm.imprecise b/test/threads.fromasm.imprecise
index c8967ab2e..a35be0f7d 100644
--- a/test/threads.fromasm.imprecise
+++ b/test/threads.fromasm.imprecise
@@ -1,7 +1,7 @@
(module
(import "env" "memory" (memory $0 (shared 256 256)))
(export "test" (func $test))
- (func $test (; 0 ;)
+ (func $test (; 0 ;) (; has Stack IR ;)
(local $0 i32)
(drop
(i32.atomic.load
diff --git a/test/threads.wasm-only.fromasm b/test/threads.wasm-only.fromasm
index f633af016..4a692c18c 100644
--- a/test/threads.wasm-only.fromasm
+++ b/test/threads.wasm-only.fromasm
@@ -6,7 +6,7 @@
(export "test64" (func $legalstub$test64))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $test64 (; 0 ;) (result i64)
+ (func $test64 (; 0 ;) (; has Stack IR ;) (result i64)
(local $0 i64)
(local $1 i64)
(local $2 i32)
@@ -50,7 +50,7 @@
)
(get_local $1)
)
- (func $legalstub$test64 (; 1 ;) (result i32)
+ (func $legalstub$test64 (; 1 ;) (; has Stack IR ;) (result i32)
(local $0 i64)
(set_local $0
(call $test64)
@@ -67,10 +67,10 @@
(get_local $0)
)
)
- (func $getTempRet0 (; 2 ;) (result i32)
+ (func $getTempRet0 (; 2 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 3 ;) (param $0 i32)
+ (func $setTempRet0 (; 3 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/threads.wasm-only.fromasm.clamp b/test/threads.wasm-only.fromasm.clamp
index f633af016..4a692c18c 100644
--- a/test/threads.wasm-only.fromasm.clamp
+++ b/test/threads.wasm-only.fromasm.clamp
@@ -6,7 +6,7 @@
(export "test64" (func $legalstub$test64))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $test64 (; 0 ;) (result i64)
+ (func $test64 (; 0 ;) (; has Stack IR ;) (result i64)
(local $0 i64)
(local $1 i64)
(local $2 i32)
@@ -50,7 +50,7 @@
)
(get_local $1)
)
- (func $legalstub$test64 (; 1 ;) (result i32)
+ (func $legalstub$test64 (; 1 ;) (; has Stack IR ;) (result i32)
(local $0 i64)
(set_local $0
(call $test64)
@@ -67,10 +67,10 @@
(get_local $0)
)
)
- (func $getTempRet0 (; 2 ;) (result i32)
+ (func $getTempRet0 (; 2 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 3 ;) (param $0 i32)
+ (func $setTempRet0 (; 3 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/threads.wasm-only.fromasm.imprecise b/test/threads.wasm-only.fromasm.imprecise
index 2c6fa3f18..446dc7f7a 100644
--- a/test/threads.wasm-only.fromasm.imprecise
+++ b/test/threads.wasm-only.fromasm.imprecise
@@ -4,7 +4,7 @@
(export "test64" (func $legalstub$test64))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $test64 (; 0 ;) (result i64)
+ (func $test64 (; 0 ;) (; has Stack IR ;) (result i64)
(local $0 i64)
(local $1 i64)
(local $2 i32)
@@ -48,7 +48,7 @@
)
(get_local $1)
)
- (func $legalstub$test64 (; 1 ;) (result i32)
+ (func $legalstub$test64 (; 1 ;) (; has Stack IR ;) (result i32)
(local $0 i64)
(set_local $0
(call $test64)
@@ -65,10 +65,10 @@
(get_local $0)
)
)
- (func $getTempRet0 (; 2 ;) (result i32)
+ (func $getTempRet0 (; 2 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 3 ;) (param $0 i32)
+ (func $setTempRet0 (; 3 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/two_sides.fromasm b/test/two_sides.fromasm
index 57d11e478..af5ff5386 100644
--- a/test/two_sides.fromasm
+++ b/test/two_sides.fromasm
@@ -5,7 +5,7 @@
(import "asm2wasm" "f64-to-int" (func $f64-to-int (param f64) (result i32)))
(data (get_global $memoryBase) "two_sides.asm.js")
(export "_test" (func $_test))
- (func $_test (; 1 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_test (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 f64)
(if (result i32)
(get_local $4)
diff --git a/test/two_sides.fromasm.clamp b/test/two_sides.fromasm.clamp
index de51f2281..c21a6b868 100644
--- a/test/two_sides.fromasm.clamp
+++ b/test/two_sides.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "two_sides.asm.js")
(export "_test" (func $_test))
- (func $f64-to-int (; 0 ;) (param $0 f64) (result i32)
+ (func $f64-to-int (; 0 ;) (; has Stack IR ;) (param $0 f64) (result i32)
(if (result i32)
(f64.ne
(get_local $0)
@@ -29,7 +29,7 @@
)
)
)
- (func $_test (; 1 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_test (; 1 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 f64)
(if (result i32)
(get_local $4)
diff --git a/test/two_sides.fromasm.imprecise b/test/two_sides.fromasm.imprecise
index c4dbbb386..9115e679a 100644
--- a/test/two_sides.fromasm.imprecise
+++ b/test/two_sides.fromasm.imprecise
@@ -1,6 +1,6 @@
(module
(export "_test" (func $_test))
- (func $_test (; 0 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
+ (func $_test (; 0 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
(local $5 f64)
(if (result i32)
(get_local $4)
diff --git a/test/unit.fromasm b/test/unit.fromasm
index bddac1e56..edefbfff7 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -77,10 +77,10 @@
(export "relocatableAndModules" (func $relocatableAndModules))
(export "exported_f32_user" (func $legalstub$exported_f32_user))
(export "keepAlive" (func $keepAlive))
- (func $big_negative (; 8 ;)
+ (func $big_negative (; 8 ;) (; has Stack IR ;)
(nop)
)
- (func $importedDoubles (; 9 ;) (result f64)
+ (func $importedDoubles (; 9 ;) (; has Stack IR ;) (result f64)
(if
(i32.gt_s
(get_global $Int)
@@ -101,7 +101,7 @@
)
(f64.const 1.2)
)
- (func $doubleCompares (; 10 ;) (param $0 f64) (param $1 f64) (result f64)
+ (func $doubleCompares (; 10 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) (result f64)
(if
(f64.gt
(get_local $0)
@@ -140,12 +140,12 @@
)
(get_local $1)
)
- (func $intOps (; 11 ;) (param $0 i32) (result i32)
+ (func $intOps (; 11 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.eqz
(get_local $0)
)
)
- (func $switcher (; 12 ;) (param $0 i32) (result i32)
+ (func $switcher (; 12 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $switch
(block $switch-case0
(block $switch-case
@@ -224,22 +224,22 @@
)
(i32.const 0)
)
- (func $frem (; 13 ;) (result f64)
+ (func $frem (; 13 ;) (; has Stack IR ;) (result f64)
(call $f64-rem
(f64.const 5.5)
(f64.const 1.2)
)
)
- (func $big_uint_div_u (; 14 ;) (result i32)
+ (func $big_uint_div_u (; 14 ;) (; has Stack IR ;) (result i32)
(i32.const 2147483647)
)
- (func $trapping_sint_div_s (; 15 ;) (result i32)
+ (func $trapping_sint_div_s (; 15 ;) (; has Stack IR ;) (result i32)
(i32.const 0)
)
- (func $negZero (; 16 ;) (result f64)
+ (func $negZero (; 16 ;) (; has Stack IR ;) (result f64)
(f64.const -0)
)
- (func $neg (; 17 ;)
+ (func $neg (; 17 ;) (; has Stack IR ;)
(local $0 f32)
(call_indirect (type $FUNCSIG$vf)
(f32.neg
@@ -248,13 +248,13 @@
(i32.const 9)
)
)
- (func $cneg (; 18 ;) (param $0 f32)
+ (func $cneg (; 18 ;) (; has Stack IR ;) (param $0 f32)
(call_indirect (type $FUNCSIG$vf)
(get_local $0)
(i32.const 9)
)
)
- (func $smallCompare (; 19 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $smallCompare (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if
(i32.lt_s
(get_local $0)
@@ -281,13 +281,13 @@
)
(get_local $0)
)
- (func $cneg_nosemicolon (; 20 ;)
+ (func $cneg_nosemicolon (; 20 ;) (; has Stack IR ;)
(call_indirect (type $FUNCSIG$vi)
(i32.const 1)
(i32.const 17)
)
)
- (func $forLoop (; 21 ;)
+ (func $forLoop (; 21 ;) (; has Stack IR ;)
(local $0 i32)
(set_local $0
(i32.const 1)
@@ -313,7 +313,7 @@
)
)
)
- (func $aborts (; 22 ;)
+ (func $aborts (; 22 ;) (; has Stack IR ;)
(drop
(call $abort
(f64.const 0)
@@ -342,7 +342,7 @@
)
)
)
- (func $continues (; 23 ;)
+ (func $continues (; 23 ;) (; has Stack IR ;)
(loop $while-in
(call $print
(i32.const 1)
@@ -361,7 +361,7 @@
(br $while-in)
)
)
- (func $recursiveBlockMerging (; 24 ;) (param $0 i32) (result i32)
+ (func $recursiveBlockMerging (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(drop
(call $lb
(i32.add
@@ -436,7 +436,7 @@
)
)
)
- (func $lb (; 25 ;) (param $0 i32) (result i32)
+ (func $lb (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.store
(get_local $0)
(i32.add
@@ -446,7 +446,7 @@
)
(i32.const 0)
)
- (func $zeroInit (; 26 ;) (param $0 i32)
+ (func $zeroInit (; 26 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(call $lb
@@ -476,7 +476,7 @@
)
)
)
- (func $phi (; 27 ;) (result i32)
+ (func $phi (; 27 ;) (; has Stack IR ;) (result i32)
(block $do-once (result i32)
(drop
(br_if $do-once
@@ -489,7 +489,7 @@
(i32.const 1)
)
)
- (func $smallIf (; 28 ;)
+ (func $smallIf (; 28 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -499,7 +499,7 @@
)
)
)
- (func $dropCall (; 29 ;) (result i32)
+ (func $dropCall (; 29 ;) (; has Stack IR ;) (result i32)
(if
(call $return_int)
(block
@@ -520,7 +520,7 @@
)
(call $phi)
)
- (func $useSetGlobal (; 30 ;) (result i32)
+ (func $useSetGlobal (; 30 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 10)
)
@@ -532,13 +532,13 @@
)
(get_global $Int)
)
- (func $usesSetGlobal2 (; 31 ;) (result i32)
+ (func $usesSetGlobal2 (; 31 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 40)
)
(i32.const 50)
)
- (func $breakThroughMany (; 32 ;) (param $0 i32)
+ (func $breakThroughMany (; 32 ;) (; has Stack IR ;) (param $0 i32)
(block $label$break$L1
(if
(get_local $0)
@@ -556,7 +556,7 @@
)
)
)
- (func $ifChainEmpty (; 33 ;) (param $0 i32) (result i32)
+ (func $ifChainEmpty (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if
(i32.eq
(get_local $0)
@@ -568,12 +568,12 @@
)
(i32.const 0)
)
- (func $heap8NoShift (; 34 ;) (param $0 i32) (result i32)
+ (func $heap8NoShift (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.load8_s
(get_local $0)
)
)
- (func $conditionalTypeFun (; 35 ;)
+ (func $conditionalTypeFun (; 35 ;) (; has Stack IR ;)
(drop
(if (result i32)
(call $return_int)
@@ -599,7 +599,7 @@
)
)
)
- (func $loadSigned (; 36 ;) (param $0 i32)
+ (func $loadSigned (; 36 ;) (; has Stack IR ;) (param $0 i32)
(call $loadSigned
(i32.load8_s
(get_local $0)
@@ -665,13 +665,13 @@
)
)
)
- (func $z (; 37 ;) (param $0 f32)
+ (func $z (; 37 ;) (; has Stack IR ;) (param $0 f32)
(nop)
)
- (func $w (; 38 ;) (result f64)
+ (func $w (; 38 ;) (; has Stack IR ;) (result f64)
(f64.const 0)
)
- (func $globalOpts (; 39 ;)
+ (func $globalOpts (; 39 ;) (; has Stack IR ;)
(local $0 i32)
(i32.store8
(i32.const 13)
@@ -701,7 +701,7 @@
(get_local $0)
)
)
- (func $dropCallImport (; 40 ;)
+ (func $dropCallImport (; 40 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -709,7 +709,7 @@
)
)
)
- (func $loophi (; 41 ;) (param $0 i32) (param $1 i32)
+ (func $loophi (; 41 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(local $2 i32)
(loop $while-in
(block $while-out
@@ -739,7 +739,7 @@
)
)
)
- (func $loophi2 (; 42 ;) (result i32)
+ (func $loophi2 (; 42 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@@ -772,7 +772,7 @@
)
(get_local $1)
)
- (func $loophi2b (; 43 ;) (result i32)
+ (func $loophi2b (; 43 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(loop $label$continue$L7
@@ -804,7 +804,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading (; 44 ;) (param $0 i32) (result i32)
+ (func $relooperJumpThreading (; 44 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $__rjto$0
(block $__rjti$0
(if
@@ -973,7 +973,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 45 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
+ (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 45 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
(loop $while-in
(block $__rjto$1
(block $__rjti$1
@@ -1000,7 +1000,7 @@
(br $while-in)
)
)
- (func $relooperJumpThreading_irreducible (; 46 ;) (param $0 i32)
+ (func $relooperJumpThreading_irreducible (; 46 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(i32.eq
@@ -1052,7 +1052,7 @@
)
)
)
- (func $__Z12multi_varargiz (; 47 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
+ (func $__Z12multi_varargiz (; 47 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(if
(get_local $3)
(loop $while-in
@@ -1069,10 +1069,10 @@
)
)
)
- (func $jumpThreadDrop (; 48 ;) (result i32)
+ (func $jumpThreadDrop (; 48 ;) (; has Stack IR ;) (result i32)
(call $return_int)
)
- (func $dropIgnoredImportInIf (; 49 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportInIf (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(if
(get_local $0)
(drop
@@ -1082,7 +1082,7 @@
)
)
)
- (func $dropIgnoredImportsInIf (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportsInIf (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(drop
(if (result i32)
(get_local $0)
@@ -1095,7 +1095,7 @@
)
)
)
- (func $store_fround (; 51 ;) (param $0 i32)
+ (func $store_fround (; 51 ;) (; has Stack IR ;) (param $0 i32)
(f64.store
(i32.const 80)
(f64.promote/f32
@@ -1105,7 +1105,7 @@
)
)
)
- (func $relocatableAndModules (; 52 ;) (result i32)
+ (func $relocatableAndModules (; 52 ;) (; has Stack IR ;) (result i32)
(call_indirect (type $FUNCSIG$v)
(i32.const 10)
)
@@ -1118,7 +1118,7 @@
(i32.const 30)
)
)
- (func $sqrts (; 53 ;) (param $0 f64) (result f64)
+ (func $sqrts (; 53 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.add
(f64.sqrt
(get_local $0)
@@ -1132,7 +1132,7 @@
)
)
)
- (func $keepAlive (; 54 ;)
+ (func $keepAlive (; 54 ;) (; has Stack IR ;)
(drop
(call $sqrts
(f64.const 3.14159)
@@ -1181,13 +1181,13 @@
)
)
)
- (func $vi (; 55 ;) (param $0 i32)
+ (func $vi (; 55 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $ii (; 56 ;) (param $0 i32) (result i32)
+ (func $ii (; 56 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(get_local $0)
)
- (func $legalstub$conversions (; 57 ;) (param $0 i32) (param $1 f64) (param $2 f64)
+ (func $legalstub$conversions (; 57 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64)
(drop
(call $f64-to-int
(get_local $1)
@@ -1203,7 +1203,7 @@
)
)
)
- (func $legalstub$frem_float (; 58 ;) (result f64)
+ (func $legalstub$frem_float (; 58 ;) (; has Stack IR ;) (result f64)
(f64.promote/f32
(f32.demote/f64
(call $f64-rem
@@ -1213,16 +1213,16 @@
)
)
)
- (func $legalstub$fr (; 59 ;) (param $0 f64)
+ (func $legalstub$fr (; 59 ;) (; has Stack IR ;) (param $0 f64)
(nop)
)
- (func $legalstub$ceiling_32_64 (; 60 ;) (param $0 f64) (param $1 f64)
+ (func $legalstub$ceiling_32_64 (; 60 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64)
(nop)
)
- (func $legalstub$bitcasts (; 61 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
- (func $legalstub$exported_f32_user (; 62 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (func $legalstub$exported_f32_user (; 62 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
(f64.promote/f32
(f32.demote/f64
(get_local $1)
diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp
index 501fa7145..ee2c395df 100644
--- a/test/unit.fromasm.clamp
+++ b/test/unit.fromasm.clamp
@@ -75,10 +75,10 @@
(export "relocatableAndModules" (func $relocatableAndModules))
(export "exported_f32_user" (func $legalstub$exported_f32_user))
(export "keepAlive" (func $keepAlive))
- (func $big_negative (; 7 ;)
+ (func $big_negative (; 7 ;) (; has Stack IR ;)
(nop)
)
- (func $importedDoubles (; 8 ;) (result f64)
+ (func $importedDoubles (; 8 ;) (; has Stack IR ;) (result f64)
(if
(i32.gt_s
(get_global $Int)
@@ -99,7 +99,7 @@
)
(f64.const 1.2)
)
- (func $doubleCompares (; 9 ;) (param $0 f64) (param $1 f64) (result f64)
+ (func $doubleCompares (; 9 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) (result f64)
(if
(f64.gt
(get_local $0)
@@ -138,12 +138,12 @@
)
(get_local $1)
)
- (func $intOps (; 10 ;) (param $0 i32) (result i32)
+ (func $intOps (; 10 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.eqz
(get_local $0)
)
)
- (func $f64-to-int (; 11 ;) (param $0 f64) (result i32)
+ (func $f64-to-int (; 11 ;) (; has Stack IR ;) (param $0 f64) (result i32)
(if (result i32)
(f64.ne
(get_local $0)
@@ -169,7 +169,7 @@
)
)
)
- (func $f32-to-int (; 12 ;) (param $0 f32) (result i32)
+ (func $f32-to-int (; 12 ;) (; has Stack IR ;) (param $0 f32) (result i32)
(if (result i32)
(f32.ne
(get_local $0)
@@ -195,7 +195,7 @@
)
)
)
- (func $switcher (; 13 ;) (param $0 i32) (result i32)
+ (func $switcher (; 13 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $switch
(block $switch-case0
(block $switch-case
@@ -274,22 +274,22 @@
)
(i32.const 0)
)
- (func $frem (; 14 ;) (result f64)
+ (func $frem (; 14 ;) (; has Stack IR ;) (result f64)
(call $f64-rem
(f64.const 5.5)
(f64.const 1.2)
)
)
- (func $big_uint_div_u (; 15 ;) (result i32)
+ (func $big_uint_div_u (; 15 ;) (; has Stack IR ;) (result i32)
(i32.const 2147483647)
)
- (func $trapping_sint_div_s (; 16 ;) (result i32)
+ (func $trapping_sint_div_s (; 16 ;) (; has Stack IR ;) (result i32)
(i32.const 0)
)
- (func $negZero (; 17 ;) (result f64)
+ (func $negZero (; 17 ;) (; has Stack IR ;) (result f64)
(f64.const -0)
)
- (func $neg (; 18 ;)
+ (func $neg (; 18 ;) (; has Stack IR ;)
(local $0 f32)
(call_indirect (type $FUNCSIG$vf)
(f32.neg
@@ -298,13 +298,13 @@
(i32.const 9)
)
)
- (func $cneg (; 19 ;) (param $0 f32)
+ (func $cneg (; 19 ;) (; has Stack IR ;) (param $0 f32)
(call_indirect (type $FUNCSIG$vf)
(get_local $0)
(i32.const 9)
)
)
- (func $smallCompare (; 20 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $smallCompare (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if
(i32.lt_s
(get_local $0)
@@ -331,13 +331,13 @@
)
(get_local $0)
)
- (func $cneg_nosemicolon (; 21 ;)
+ (func $cneg_nosemicolon (; 21 ;) (; has Stack IR ;)
(call_indirect (type $FUNCSIG$vi)
(i32.const 1)
(i32.const 17)
)
)
- (func $forLoop (; 22 ;)
+ (func $forLoop (; 22 ;) (; has Stack IR ;)
(local $0 i32)
(set_local $0
(i32.const 1)
@@ -363,7 +363,7 @@
)
)
)
- (func $aborts (; 23 ;)
+ (func $aborts (; 23 ;) (; has Stack IR ;)
(drop
(call $abort
(f64.const 0)
@@ -392,7 +392,7 @@
)
)
)
- (func $continues (; 24 ;)
+ (func $continues (; 24 ;) (; has Stack IR ;)
(loop $while-in
(call $print
(i32.const 1)
@@ -411,7 +411,7 @@
(br $while-in)
)
)
- (func $recursiveBlockMerging (; 25 ;) (param $0 i32) (result i32)
+ (func $recursiveBlockMerging (; 25 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(drop
(call $lb
(i32.add
@@ -486,7 +486,7 @@
)
)
)
- (func $lb (; 26 ;) (param $0 i32) (result i32)
+ (func $lb (; 26 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.store
(get_local $0)
(i32.add
@@ -496,7 +496,7 @@
)
(i32.const 0)
)
- (func $zeroInit (; 27 ;) (param $0 i32)
+ (func $zeroInit (; 27 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(call $lb
@@ -526,7 +526,7 @@
)
)
)
- (func $phi (; 28 ;) (result i32)
+ (func $phi (; 28 ;) (; has Stack IR ;) (result i32)
(block $do-once (result i32)
(drop
(br_if $do-once
@@ -539,7 +539,7 @@
(i32.const 1)
)
)
- (func $smallIf (; 29 ;)
+ (func $smallIf (; 29 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -549,7 +549,7 @@
)
)
)
- (func $dropCall (; 30 ;) (result i32)
+ (func $dropCall (; 30 ;) (; has Stack IR ;) (result i32)
(if
(call $return_int)
(block
@@ -570,7 +570,7 @@
)
(call $phi)
)
- (func $useSetGlobal (; 31 ;) (result i32)
+ (func $useSetGlobal (; 31 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 10)
)
@@ -582,13 +582,13 @@
)
(get_global $Int)
)
- (func $usesSetGlobal2 (; 32 ;) (result i32)
+ (func $usesSetGlobal2 (; 32 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 40)
)
(i32.const 50)
)
- (func $breakThroughMany (; 33 ;) (param $0 i32)
+ (func $breakThroughMany (; 33 ;) (; has Stack IR ;) (param $0 i32)
(block $label$break$L1
(if
(get_local $0)
@@ -606,7 +606,7 @@
)
)
)
- (func $ifChainEmpty (; 34 ;) (param $0 i32) (result i32)
+ (func $ifChainEmpty (; 34 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if
(i32.eq
(get_local $0)
@@ -618,12 +618,12 @@
)
(i32.const 0)
)
- (func $heap8NoShift (; 35 ;) (param $0 i32) (result i32)
+ (func $heap8NoShift (; 35 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.load8_s
(get_local $0)
)
)
- (func $conditionalTypeFun (; 36 ;)
+ (func $conditionalTypeFun (; 36 ;) (; has Stack IR ;)
(drop
(if (result i32)
(call $return_int)
@@ -649,7 +649,7 @@
)
)
)
- (func $loadSigned (; 37 ;) (param $0 i32)
+ (func $loadSigned (; 37 ;) (; has Stack IR ;) (param $0 i32)
(call $loadSigned
(i32.load8_s
(get_local $0)
@@ -715,13 +715,13 @@
)
)
)
- (func $z (; 38 ;) (param $0 f32)
+ (func $z (; 38 ;) (; has Stack IR ;) (param $0 f32)
(nop)
)
- (func $w (; 39 ;) (result f64)
+ (func $w (; 39 ;) (; has Stack IR ;) (result f64)
(f64.const 0)
)
- (func $globalOpts (; 40 ;)
+ (func $globalOpts (; 40 ;) (; has Stack IR ;)
(local $0 i32)
(i32.store8
(i32.const 13)
@@ -751,7 +751,7 @@
(get_local $0)
)
)
- (func $dropCallImport (; 41 ;)
+ (func $dropCallImport (; 41 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -759,7 +759,7 @@
)
)
)
- (func $loophi (; 42 ;) (param $0 i32) (param $1 i32)
+ (func $loophi (; 42 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(local $2 i32)
(loop $while-in
(block $while-out
@@ -789,7 +789,7 @@
)
)
)
- (func $loophi2 (; 43 ;) (result i32)
+ (func $loophi2 (; 43 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@@ -822,7 +822,7 @@
)
(get_local $1)
)
- (func $loophi2b (; 44 ;) (result i32)
+ (func $loophi2b (; 44 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(loop $label$continue$L7
@@ -854,7 +854,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading (; 45 ;) (param $0 i32) (result i32)
+ (func $relooperJumpThreading (; 45 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $__rjto$0
(block $__rjti$0
(if
@@ -1023,7 +1023,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 46 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
+ (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
(loop $while-in
(block $__rjto$1
(block $__rjti$1
@@ -1050,7 +1050,7 @@
(br $while-in)
)
)
- (func $relooperJumpThreading_irreducible (; 47 ;) (param $0 i32)
+ (func $relooperJumpThreading_irreducible (; 47 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(i32.eq
@@ -1102,7 +1102,7 @@
)
)
)
- (func $__Z12multi_varargiz (; 48 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
+ (func $__Z12multi_varargiz (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(if
(get_local $3)
(loop $while-in
@@ -1119,10 +1119,10 @@
)
)
)
- (func $jumpThreadDrop (; 49 ;) (result i32)
+ (func $jumpThreadDrop (; 49 ;) (; has Stack IR ;) (result i32)
(call $return_int)
)
- (func $dropIgnoredImportInIf (; 50 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportInIf (; 50 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(if
(get_local $0)
(drop
@@ -1132,7 +1132,7 @@
)
)
)
- (func $dropIgnoredImportsInIf (; 51 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportsInIf (; 51 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(drop
(if (result i32)
(get_local $0)
@@ -1145,7 +1145,7 @@
)
)
)
- (func $store_fround (; 52 ;) (param $0 i32)
+ (func $store_fround (; 52 ;) (; has Stack IR ;) (param $0 i32)
(f64.store
(i32.const 80)
(f64.promote/f32
@@ -1155,7 +1155,7 @@
)
)
)
- (func $relocatableAndModules (; 53 ;) (result i32)
+ (func $relocatableAndModules (; 53 ;) (; has Stack IR ;) (result i32)
(call_indirect (type $FUNCSIG$v)
(i32.const 10)
)
@@ -1168,7 +1168,7 @@
(i32.const 30)
)
)
- (func $sqrts (; 54 ;) (param $0 f64) (result f64)
+ (func $sqrts (; 54 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.add
(f64.sqrt
(get_local $0)
@@ -1182,7 +1182,7 @@
)
)
)
- (func $f64-to-uint (; 55 ;) (param $0 f64) (result i32)
+ (func $f64-to-uint (; 55 ;) (; has Stack IR ;) (param $0 f64) (result i32)
(if (result i32)
(f64.ne
(get_local $0)
@@ -1208,7 +1208,7 @@
)
)
)
- (func $keepAlive (; 56 ;)
+ (func $keepAlive (; 56 ;) (; has Stack IR ;)
(drop
(call $sqrts
(f64.const 3.14159)
@@ -1257,13 +1257,13 @@
)
)
)
- (func $vi (; 57 ;) (param $0 i32)
+ (func $vi (; 57 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $ii (; 58 ;) (param $0 i32) (result i32)
+ (func $ii (; 58 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(get_local $0)
)
- (func $legalstub$conversions (; 59 ;) (param $0 i32) (param $1 f64) (param $2 f64)
+ (func $legalstub$conversions (; 59 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64)
(drop
(call $f64-to-int
(get_local $1)
@@ -1277,7 +1277,7 @@
)
)
)
- (func $legalstub$frem_float (; 60 ;) (result f64)
+ (func $legalstub$frem_float (; 60 ;) (; has Stack IR ;) (result f64)
(f64.promote/f32
(f32.demote/f64
(call $f64-rem
@@ -1287,16 +1287,16 @@
)
)
)
- (func $legalstub$fr (; 61 ;) (param $0 f64)
+ (func $legalstub$fr (; 61 ;) (; has Stack IR ;) (param $0 f64)
(nop)
)
- (func $legalstub$ceiling_32_64 (; 62 ;) (param $0 f64) (param $1 f64)
+ (func $legalstub$ceiling_32_64 (; 62 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64)
(nop)
)
- (func $legalstub$bitcasts (; 63 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 63 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
- (func $legalstub$exported_f32_user (; 64 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (func $legalstub$exported_f32_user (; 64 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
(f64.promote/f32
(f32.demote/f64
(get_local $1)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index bc293072a..b8f679fb4 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -73,10 +73,10 @@
(export "relocatableAndModules" (func $relocatableAndModules))
(export "exported_f32_user" (func $legalstub$exported_f32_user))
(export "keepAlive" (func $keepAlive))
- (func $big_negative (; 7 ;)
+ (func $big_negative (; 7 ;) (; has Stack IR ;)
(nop)
)
- (func $importedDoubles (; 8 ;) (result f64)
+ (func $importedDoubles (; 8 ;) (; has Stack IR ;) (result f64)
(if
(i32.gt_s
(get_global $Int)
@@ -97,7 +97,7 @@
)
(f64.const 1.2)
)
- (func $doubleCompares (; 9 ;) (param $0 f64) (param $1 f64) (result f64)
+ (func $doubleCompares (; 9 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64) (result f64)
(if
(f64.gt
(get_local $0)
@@ -136,12 +136,12 @@
)
(get_local $1)
)
- (func $intOps (; 10 ;) (param $0 i32) (result i32)
+ (func $intOps (; 10 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.eqz
(get_local $0)
)
)
- (func $switcher (; 11 ;) (param $0 i32) (result i32)
+ (func $switcher (; 11 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $switch
(block $switch-case0
(block $switch-case
@@ -220,25 +220,25 @@
)
(i32.const 0)
)
- (func $frem (; 12 ;) (result f64)
+ (func $frem (; 12 ;) (; has Stack IR ;) (result f64)
(call $f64-rem
(f64.const 5.5)
(f64.const 1.2)
)
)
- (func $big_uint_div_u (; 13 ;) (result i32)
+ (func $big_uint_div_u (; 13 ;) (; has Stack IR ;) (result i32)
(i32.const 2147483647)
)
- (func $trapping_sint_div_s (; 14 ;) (result i32)
+ (func $trapping_sint_div_s (; 14 ;) (; has Stack IR ;) (result i32)
(i32.div_s
(i32.const -2147483648)
(i32.const -1)
)
)
- (func $negZero (; 15 ;) (result f64)
+ (func $negZero (; 15 ;) (; has Stack IR ;) (result f64)
(f64.const -0)
)
- (func $neg (; 16 ;)
+ (func $neg (; 16 ;) (; has Stack IR ;)
(local $0 f32)
(call_indirect (type $FUNCSIG$vf)
(f32.neg
@@ -247,13 +247,13 @@
(i32.const 9)
)
)
- (func $cneg (; 17 ;) (param $0 f32)
+ (func $cneg (; 17 ;) (; has Stack IR ;) (param $0 f32)
(call_indirect (type $FUNCSIG$vf)
(get_local $0)
(i32.const 9)
)
)
- (func $smallCompare (; 18 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $smallCompare (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(if
(i32.lt_s
(get_local $0)
@@ -280,13 +280,13 @@
)
(get_local $0)
)
- (func $cneg_nosemicolon (; 19 ;)
+ (func $cneg_nosemicolon (; 19 ;) (; has Stack IR ;)
(call_indirect (type $FUNCSIG$vi)
(i32.const 1)
(i32.const 17)
)
)
- (func $forLoop (; 20 ;)
+ (func $forLoop (; 20 ;) (; has Stack IR ;)
(local $0 i32)
(set_local $0
(i32.const 1)
@@ -312,7 +312,7 @@
)
)
)
- (func $aborts (; 21 ;)
+ (func $aborts (; 21 ;) (; has Stack IR ;)
(drop
(call $abort
(f64.const 0)
@@ -341,7 +341,7 @@
)
)
)
- (func $continues (; 22 ;)
+ (func $continues (; 22 ;) (; has Stack IR ;)
(loop $while-in
(call $print
(i32.const 1)
@@ -360,7 +360,7 @@
(br $while-in)
)
)
- (func $recursiveBlockMerging (; 23 ;) (param $0 i32) (result i32)
+ (func $recursiveBlockMerging (; 23 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(drop
(call $lb
(i32.add
@@ -435,7 +435,7 @@
)
)
)
- (func $lb (; 24 ;) (param $0 i32) (result i32)
+ (func $lb (; 24 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.store
(get_local $0)
(i32.add
@@ -445,7 +445,7 @@
)
(i32.const 0)
)
- (func $zeroInit (; 25 ;) (param $0 i32)
+ (func $zeroInit (; 25 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(call $lb
@@ -475,7 +475,7 @@
)
)
)
- (func $phi (; 26 ;) (result i32)
+ (func $phi (; 26 ;) (; has Stack IR ;) (result i32)
(block $do-once (result i32)
(drop
(br_if $do-once
@@ -488,7 +488,7 @@
(i32.const 1)
)
)
- (func $smallIf (; 27 ;)
+ (func $smallIf (; 27 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -498,7 +498,7 @@
)
)
)
- (func $dropCall (; 28 ;) (result i32)
+ (func $dropCall (; 28 ;) (; has Stack IR ;) (result i32)
(if
(call $return_int)
(block
@@ -519,7 +519,7 @@
)
(call $phi)
)
- (func $useSetGlobal (; 29 ;) (result i32)
+ (func $useSetGlobal (; 29 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 10)
)
@@ -531,13 +531,13 @@
)
(get_global $Int)
)
- (func $usesSetGlobal2 (; 30 ;) (result i32)
+ (func $usesSetGlobal2 (; 30 ;) (; has Stack IR ;) (result i32)
(set_global $Int
(i32.const 40)
)
(i32.const 50)
)
- (func $breakThroughMany (; 31 ;) (param $0 i32)
+ (func $breakThroughMany (; 31 ;) (; has Stack IR ;) (param $0 i32)
(block $label$break$L1
(if
(get_local $0)
@@ -555,7 +555,7 @@
)
)
)
- (func $ifChainEmpty (; 32 ;) (param $0 i32) (result i32)
+ (func $ifChainEmpty (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(if
(i32.eq
(get_local $0)
@@ -567,12 +567,12 @@
)
(i32.const 0)
)
- (func $heap8NoShift (; 33 ;) (param $0 i32) (result i32)
+ (func $heap8NoShift (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(i32.load8_s
(get_local $0)
)
)
- (func $conditionalTypeFun (; 34 ;)
+ (func $conditionalTypeFun (; 34 ;) (; has Stack IR ;)
(drop
(if (result i32)
(call $return_int)
@@ -598,7 +598,7 @@
)
)
)
- (func $loadSigned (; 35 ;) (param $0 i32)
+ (func $loadSigned (; 35 ;) (; has Stack IR ;) (param $0 i32)
(call $loadSigned
(i32.load8_s
(get_local $0)
@@ -664,13 +664,13 @@
)
)
)
- (func $z (; 36 ;) (param $0 f32)
+ (func $z (; 36 ;) (; has Stack IR ;) (param $0 f32)
(nop)
)
- (func $w (; 37 ;) (result f64)
+ (func $w (; 37 ;) (; has Stack IR ;) (result f64)
(f64.const 0)
)
- (func $globalOpts (; 38 ;)
+ (func $globalOpts (; 38 ;) (; has Stack IR ;)
(local $0 i32)
(i32.store8
(i32.const 13)
@@ -700,7 +700,7 @@
(get_local $0)
)
)
- (func $dropCallImport (; 39 ;)
+ (func $dropCallImport (; 39 ;) (; has Stack IR ;)
(if
(call $return_int)
(drop
@@ -708,7 +708,7 @@
)
)
)
- (func $loophi (; 40 ;) (param $0 i32) (param $1 i32)
+ (func $loophi (; 40 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32)
(local $2 i32)
(loop $while-in
(block $while-out
@@ -738,7 +738,7 @@
)
)
)
- (func $loophi2 (; 41 ;) (result i32)
+ (func $loophi2 (; 41 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@@ -771,7 +771,7 @@
)
(get_local $1)
)
- (func $loophi2b (; 42 ;) (result i32)
+ (func $loophi2b (; 42 ;) (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(loop $label$continue$L7
@@ -803,7 +803,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading (; 43 ;) (param $0 i32) (result i32)
+ (func $relooperJumpThreading (; 43 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(block $__rjto$0
(block $__rjti$0
(if
@@ -972,7 +972,7 @@
)
(get_local $0)
)
- (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 44 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
+ (func $relooperJumpThreading__ZN4game14preloadweaponsEv (; 44 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32) (param $6 i32)
(loop $while-in
(block $__rjto$1
(block $__rjti$1
@@ -999,7 +999,7 @@
(br $while-in)
)
)
- (func $relooperJumpThreading_irreducible (; 45 ;) (param $0 i32)
+ (func $relooperJumpThreading_irreducible (; 45 ;) (; has Stack IR ;) (param $0 i32)
(local $1 i32)
(if
(i32.eq
@@ -1051,7 +1051,7 @@
)
)
)
- (func $__Z12multi_varargiz (; 46 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
+ (func $__Z12multi_varargiz (; 46 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(if
(get_local $3)
(loop $while-in
@@ -1068,10 +1068,10 @@
)
)
)
- (func $jumpThreadDrop (; 47 ;) (result i32)
+ (func $jumpThreadDrop (; 47 ;) (; has Stack IR ;) (result i32)
(call $return_int)
)
- (func $dropIgnoredImportInIf (; 48 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportInIf (; 48 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(if
(get_local $0)
(drop
@@ -1081,7 +1081,7 @@
)
)
)
- (func $dropIgnoredImportsInIf (; 49 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $dropIgnoredImportsInIf (; 49 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(drop
(if (result i32)
(get_local $0)
@@ -1094,7 +1094,7 @@
)
)
)
- (func $store_fround (; 50 ;) (param $0 i32)
+ (func $store_fround (; 50 ;) (; has Stack IR ;) (param $0 i32)
(f64.store
(i32.const 80)
(f64.promote/f32
@@ -1104,7 +1104,7 @@
)
)
)
- (func $relocatableAndModules (; 51 ;) (result i32)
+ (func $relocatableAndModules (; 51 ;) (; has Stack IR ;) (result i32)
(call_indirect (type $FUNCSIG$v)
(i32.const 10)
)
@@ -1117,7 +1117,7 @@
(i32.const 30)
)
)
- (func $sqrts (; 52 ;) (param $0 f64) (result f64)
+ (func $sqrts (; 52 ;) (; has Stack IR ;) (param $0 f64) (result f64)
(f64.add
(f64.sqrt
(get_local $0)
@@ -1131,7 +1131,7 @@
)
)
)
- (func $keepAlive (; 53 ;)
+ (func $keepAlive (; 53 ;) (; has Stack IR ;)
(drop
(call $sqrts
(f64.const 3.14159)
@@ -1168,16 +1168,16 @@
)
)
)
- (func $vi (; 54 ;) (param $0 i32)
+ (func $vi (; 54 ;) (; has Stack IR ;) (param $0 i32)
(nop)
)
- (func $ii (; 55 ;) (param $0 i32) (result i32)
+ (func $ii (; 55 ;) (; has Stack IR ;) (param $0 i32) (result i32)
(get_local $0)
)
- (func $legalstub$conversions (; 56 ;) (param $0 i32) (param $1 f64) (param $2 f64)
+ (func $legalstub$conversions (; 56 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64)
(nop)
)
- (func $legalstub$frem_float (; 57 ;) (result f64)
+ (func $legalstub$frem_float (; 57 ;) (; has Stack IR ;) (result f64)
(f64.promote/f32
(f32.demote/f64
(call $f64-rem
@@ -1187,16 +1187,16 @@
)
)
)
- (func $legalstub$fr (; 58 ;) (param $0 f64)
+ (func $legalstub$fr (; 58 ;) (; has Stack IR ;) (param $0 f64)
(nop)
)
- (func $legalstub$ceiling_32_64 (; 59 ;) (param $0 f64) (param $1 f64)
+ (func $legalstub$ceiling_32_64 (; 59 ;) (; has Stack IR ;) (param $0 f64) (param $1 f64)
(nop)
)
- (func $legalstub$bitcasts (; 60 ;) (param $0 i32) (param $1 f64)
+ (func $legalstub$bitcasts (; 60 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64)
(nop)
)
- (func $legalstub$exported_f32_user (; 61 ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
+ (func $legalstub$exported_f32_user (; 61 ;) (; has Stack IR ;) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
(f64.promote/f32
(f32.demote/f64
(get_local $1)
diff --git a/test/unreachable-import_wasm-only.fromasm b/test/unreachable-import_wasm-only.fromasm
index f15b613d5..ab59d9b8b 100644
--- a/test/unreachable-import_wasm-only.fromasm
+++ b/test/unreachable-import_wasm-only.fromasm
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "unreachable-import_wasm-only.asm.js")
(export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb))
- (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (param $0 i32)
+ (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32)
(i32.store
(i32.const 12)
(i32.const 26)
diff --git a/test/unreachable-import_wasm-only.fromasm.clamp b/test/unreachable-import_wasm-only.fromasm.clamp
index f15b613d5..ab59d9b8b 100644
--- a/test/unreachable-import_wasm-only.fromasm.clamp
+++ b/test/unreachable-import_wasm-only.fromasm.clamp
@@ -3,7 +3,7 @@
(import "env" "memoryBase" (global $memoryBase i32))
(data (get_global $memoryBase) "unreachable-import_wasm-only.asm.js")
(export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb))
- (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (param $0 i32)
+ (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32)
(i32.store
(i32.const 12)
(i32.const 26)
diff --git a/test/unreachable-import_wasm-only.fromasm.imprecise b/test/unreachable-import_wasm-only.fromasm.imprecise
index c80b32eb0..1f079f7c1 100644
--- a/test/unreachable-import_wasm-only.fromasm.imprecise
+++ b/test/unreachable-import_wasm-only.fromasm.imprecise
@@ -1,7 +1,7 @@
(module
(import "env" "memory" (memory $0 256 256))
(export "__ZN10WasmAssertC2Ev__async_cb" (func $__ZN10WasmAssertC2Ev__async_cb))
- (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (param $0 i32)
+ (func $__ZN10WasmAssertC2Ev__async_cb (; 0 ;) (; has Stack IR ;) (param $0 i32)
(i32.store
(i32.const 12)
(i32.const 26)
diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm
index 22414155e..0593e609a 100644
--- a/test/wasm-only.fromasm
+++ b/test/wasm-only.fromasm
@@ -19,7 +19,7 @@
(export "keepAlive" (func $keepAlive))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $loads (; 4 ;)
+ (func $loads (; 4 ;) (; has Stack IR ;)
(drop
(i32.load8_s
(i32.const 100)
@@ -131,7 +131,7 @@
)
)
)
- (func $stores (; 5 ;)
+ (func $stores (; 5 ;) (; has Stack IR ;)
(local $0 i32)
(local $1 f64)
(local $2 f32)
@@ -224,7 +224,7 @@
(get_local $1)
)
)
- (func $test (; 6 ;)
+ (func $test (; 6 ;) (; has Stack IR ;)
(local $0 f32)
(local $1 i32)
(set_local $1
@@ -233,7 +233,7 @@
)
)
)
- (func $i64s-div (; 7 ;) (param $0 i64) (param $1 i64) (result i64)
+ (func $i64s-div (; 7 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
@@ -258,7 +258,7 @@
)
)
)
- (func $f32-to-int64 (; 8 ;) (param $0 f32) (result i64)
+ (func $f32-to-int64 (; 8 ;) (; has Stack IR ;) (param $0 f32) (result i64)
(if (result i64)
(f32.ne
(get_local $0)
@@ -284,7 +284,7 @@
)
)
)
- (func $f64-to-int64 (; 9 ;) (param $0 f64) (result i64)
+ (func $f64-to-int64 (; 9 ;) (; has Stack IR ;) (param $0 f64) (result i64)
(if (result i64)
(f64.ne
(get_local $0)
@@ -310,7 +310,7 @@
)
)
)
- (func $f32-to-uint64 (; 10 ;) (param $0 f32) (result i64)
+ (func $f32-to-uint64 (; 10 ;) (; has Stack IR ;) (param $0 f32) (result i64)
(if (result i64)
(f32.ne
(get_local $0)
@@ -336,7 +336,7 @@
)
)
)
- (func $f64-to-uint64 (; 11 ;) (param $0 f64) (result i64)
+ (func $f64-to-uint64 (; 11 ;) (; has Stack IR ;) (param $0 f64) (result i64)
(if (result i64)
(f64.ne
(get_local $0)
@@ -362,7 +362,7 @@
)
)
)
- (func $test64 (; 12 ;)
+ (func $test64 (; 12 ;) (; has Stack IR ;)
(local $0 i64)
(local $1 f32)
(local $2 f64)
@@ -461,7 +461,7 @@
)
)
)
- (func $imports (; 13 ;) (result i64)
+ (func $imports (; 13 ;) (; has Stack IR ;) (result i64)
(call $legalfunc$illegalImport
(f64.const -3.13159)
(i64.const 94489280523)
@@ -479,7 +479,7 @@
)
)
)
- (func $arg (; 14 ;) (param $0 i64)
+ (func $arg (; 14 ;) (; has Stack IR ;) (param $0 i64)
(i64.store
(i32.const 100)
(get_local $0)
@@ -488,7 +488,7 @@
(get_local $0)
)
)
- (func $illegalParam (; 15 ;) (param $0 i32) (param $1 i64) (param $2 f64)
+ (func $illegalParam (; 15 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64)
(i64.store
(i32.const 100)
(get_local $1)
@@ -499,12 +499,12 @@
(f64.const 12.34)
)
)
- (func $call1 (; 16 ;) (param $0 i64) (result i64)
+ (func $call1 (; 16 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(call $call1
(get_local $0)
)
)
- (func $call2 (; 17 ;) (param $0 i64) (result i64)
+ (func $call2 (; 17 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(drop
(call $call2
(call $call2
@@ -514,13 +514,13 @@
)
(i64.const 245127260211081)
)
- (func $ifValue32 (; 18 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ifValue32 (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call $ifValue32
(get_local $0)
(get_local $1)
)
)
- (func $switch64 (; 19 ;) (param $0 i64) (result i32)
+ (func $switch64 (; 19 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(block $switch (result i32)
(block $switch-default
(block $switch-case0
@@ -555,7 +555,7 @@
(i32.const 1)
)
)
- (func $unreachable_leftovers (; 20 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $unreachable_leftovers (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(block $__rjto$0
(if
(i32.eqz
@@ -578,7 +578,7 @@
)
)
)
- (func $switch64TOOMUCH (; 21 ;) (param $0 i64) (result i32)
+ (func $switch64TOOMUCH (; 21 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(local $1 i32)
(local $2 i64)
(block $switch-default
@@ -655,7 +655,7 @@
)
(i32.const 44)
)
- (func $_memchr (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -886,7 +886,7 @@
(get_local $0)
)
)
- (func $keepAlive (; 23 ;)
+ (func $keepAlive (; 23 ;) (; has Stack IR ;)
(call $loads)
(call $loads)
(call $stores)
@@ -980,7 +980,7 @@
)
)
)
- (func $legalstub$illegalParam (; 24 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
+ (func $legalstub$illegalParam (; 24 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
(call $illegalParam
(get_local $0)
(i64.or
@@ -997,13 +997,13 @@
(get_local $3)
)
)
- (func $legalstub$illegalResult (; 25 ;) (result i32)
+ (func $legalstub$illegalResult (; 25 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
(i32.const 1)
)
- (func $legalfunc$illegalImport (; 26 ;) (param $0 f64) (param $1 i64) (param $2 i32)
+ (func $legalfunc$illegalImport (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32)
(call $legalimport$illegalImport
(get_local $0)
(i32.wrap/i64
@@ -1018,7 +1018,7 @@
(get_local $2)
)
)
- (func $legalfunc$_fabsf (; 27 ;) (param $0 f32) (result f32)
+ (func $legalfunc$_fabsf (; 27 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.demote/f64
(call $legalimport$_fabsf
(f64.promote/f32
@@ -1027,7 +1027,7 @@
)
)
)
- (func $legalfunc$do_i64 (; 28 ;) (result i64)
+ (func $legalfunc$do_i64 (; 28 ;) (; has Stack IR ;) (result i64)
(i64.or
(i64.extend_u/i32
(call $legalimport$do_i64)
@@ -1040,10 +1040,10 @@
)
)
)
- (func $getTempRet0 (; 29 ;) (result i32)
+ (func $getTempRet0 (; 29 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 30 ;) (param $0 i32)
+ (func $setTempRet0 (; 30 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/wasm-only.fromasm.clamp b/test/wasm-only.fromasm.clamp
index 22414155e..0593e609a 100644
--- a/test/wasm-only.fromasm.clamp
+++ b/test/wasm-only.fromasm.clamp
@@ -19,7 +19,7 @@
(export "keepAlive" (func $keepAlive))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $loads (; 4 ;)
+ (func $loads (; 4 ;) (; has Stack IR ;)
(drop
(i32.load8_s
(i32.const 100)
@@ -131,7 +131,7 @@
)
)
)
- (func $stores (; 5 ;)
+ (func $stores (; 5 ;) (; has Stack IR ;)
(local $0 i32)
(local $1 f64)
(local $2 f32)
@@ -224,7 +224,7 @@
(get_local $1)
)
)
- (func $test (; 6 ;)
+ (func $test (; 6 ;) (; has Stack IR ;)
(local $0 f32)
(local $1 i32)
(set_local $1
@@ -233,7 +233,7 @@
)
)
)
- (func $i64s-div (; 7 ;) (param $0 i64) (param $1 i64) (result i64)
+ (func $i64s-div (; 7 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
@@ -258,7 +258,7 @@
)
)
)
- (func $f32-to-int64 (; 8 ;) (param $0 f32) (result i64)
+ (func $f32-to-int64 (; 8 ;) (; has Stack IR ;) (param $0 f32) (result i64)
(if (result i64)
(f32.ne
(get_local $0)
@@ -284,7 +284,7 @@
)
)
)
- (func $f64-to-int64 (; 9 ;) (param $0 f64) (result i64)
+ (func $f64-to-int64 (; 9 ;) (; has Stack IR ;) (param $0 f64) (result i64)
(if (result i64)
(f64.ne
(get_local $0)
@@ -310,7 +310,7 @@
)
)
)
- (func $f32-to-uint64 (; 10 ;) (param $0 f32) (result i64)
+ (func $f32-to-uint64 (; 10 ;) (; has Stack IR ;) (param $0 f32) (result i64)
(if (result i64)
(f32.ne
(get_local $0)
@@ -336,7 +336,7 @@
)
)
)
- (func $f64-to-uint64 (; 11 ;) (param $0 f64) (result i64)
+ (func $f64-to-uint64 (; 11 ;) (; has Stack IR ;) (param $0 f64) (result i64)
(if (result i64)
(f64.ne
(get_local $0)
@@ -362,7 +362,7 @@
)
)
)
- (func $test64 (; 12 ;)
+ (func $test64 (; 12 ;) (; has Stack IR ;)
(local $0 i64)
(local $1 f32)
(local $2 f64)
@@ -461,7 +461,7 @@
)
)
)
- (func $imports (; 13 ;) (result i64)
+ (func $imports (; 13 ;) (; has Stack IR ;) (result i64)
(call $legalfunc$illegalImport
(f64.const -3.13159)
(i64.const 94489280523)
@@ -479,7 +479,7 @@
)
)
)
- (func $arg (; 14 ;) (param $0 i64)
+ (func $arg (; 14 ;) (; has Stack IR ;) (param $0 i64)
(i64.store
(i32.const 100)
(get_local $0)
@@ -488,7 +488,7 @@
(get_local $0)
)
)
- (func $illegalParam (; 15 ;) (param $0 i32) (param $1 i64) (param $2 f64)
+ (func $illegalParam (; 15 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64)
(i64.store
(i32.const 100)
(get_local $1)
@@ -499,12 +499,12 @@
(f64.const 12.34)
)
)
- (func $call1 (; 16 ;) (param $0 i64) (result i64)
+ (func $call1 (; 16 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(call $call1
(get_local $0)
)
)
- (func $call2 (; 17 ;) (param $0 i64) (result i64)
+ (func $call2 (; 17 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(drop
(call $call2
(call $call2
@@ -514,13 +514,13 @@
)
(i64.const 245127260211081)
)
- (func $ifValue32 (; 18 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ifValue32 (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call $ifValue32
(get_local $0)
(get_local $1)
)
)
- (func $switch64 (; 19 ;) (param $0 i64) (result i32)
+ (func $switch64 (; 19 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(block $switch (result i32)
(block $switch-default
(block $switch-case0
@@ -555,7 +555,7 @@
(i32.const 1)
)
)
- (func $unreachable_leftovers (; 20 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $unreachable_leftovers (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(block $__rjto$0
(if
(i32.eqz
@@ -578,7 +578,7 @@
)
)
)
- (func $switch64TOOMUCH (; 21 ;) (param $0 i64) (result i32)
+ (func $switch64TOOMUCH (; 21 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(local $1 i32)
(local $2 i64)
(block $switch-default
@@ -655,7 +655,7 @@
)
(i32.const 44)
)
- (func $_memchr (; 22 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 22 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -886,7 +886,7 @@
(get_local $0)
)
)
- (func $keepAlive (; 23 ;)
+ (func $keepAlive (; 23 ;) (; has Stack IR ;)
(call $loads)
(call $loads)
(call $stores)
@@ -980,7 +980,7 @@
)
)
)
- (func $legalstub$illegalParam (; 24 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
+ (func $legalstub$illegalParam (; 24 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
(call $illegalParam
(get_local $0)
(i64.or
@@ -997,13 +997,13 @@
(get_local $3)
)
)
- (func $legalstub$illegalResult (; 25 ;) (result i32)
+ (func $legalstub$illegalResult (; 25 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
(i32.const 1)
)
- (func $legalfunc$illegalImport (; 26 ;) (param $0 f64) (param $1 i64) (param $2 i32)
+ (func $legalfunc$illegalImport (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32)
(call $legalimport$illegalImport
(get_local $0)
(i32.wrap/i64
@@ -1018,7 +1018,7 @@
(get_local $2)
)
)
- (func $legalfunc$_fabsf (; 27 ;) (param $0 f32) (result f32)
+ (func $legalfunc$_fabsf (; 27 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.demote/f64
(call $legalimport$_fabsf
(f64.promote/f32
@@ -1027,7 +1027,7 @@
)
)
)
- (func $legalfunc$do_i64 (; 28 ;) (result i64)
+ (func $legalfunc$do_i64 (; 28 ;) (; has Stack IR ;) (result i64)
(i64.or
(i64.extend_u/i32
(call $legalimport$do_i64)
@@ -1040,10 +1040,10 @@
)
)
)
- (func $getTempRet0 (; 29 ;) (result i32)
+ (func $getTempRet0 (; 29 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 30 ;) (param $0 i32)
+ (func $setTempRet0 (; 30 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)
diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise
index e79bbc901..6077f9429 100644
--- a/test/wasm-only.fromasm.imprecise
+++ b/test/wasm-only.fromasm.imprecise
@@ -17,7 +17,7 @@
(export "keepAlive" (func $keepAlive))
(export "getTempRet0" (func $getTempRet0))
(export "setTempRet0" (func $setTempRet0))
- (func $stores (; 4 ;)
+ (func $stores (; 4 ;) (; has Stack IR ;)
(local $0 i32)
(local $1 f64)
(local $2 f32)
@@ -110,7 +110,7 @@
(get_local $1)
)
)
- (func $test (; 5 ;)
+ (func $test (; 5 ;) (; has Stack IR ;)
(local $0 f32)
(local $1 i32)
(set_local $1
@@ -119,7 +119,7 @@
)
)
)
- (func $test64 (; 6 ;)
+ (func $test64 (; 6 ;) (; has Stack IR ;)
(local $0 i64)
(local $1 i32)
(local $2 i64)
@@ -161,7 +161,7 @@
)
)
)
- (func $imports (; 7 ;) (result i64)
+ (func $imports (; 7 ;) (; has Stack IR ;) (result i64)
(call $legalfunc$illegalImport
(f64.const -3.13159)
(i64.const 94489280523)
@@ -179,7 +179,7 @@
)
)
)
- (func $arg (; 8 ;) (param $0 i64)
+ (func $arg (; 8 ;) (; has Stack IR ;) (param $0 i64)
(i64.store
(i32.const 100)
(get_local $0)
@@ -188,7 +188,7 @@
(get_local $0)
)
)
- (func $illegalParam (; 9 ;) (param $0 i32) (param $1 i64) (param $2 f64)
+ (func $illegalParam (; 9 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64)
(i64.store
(i32.const 100)
(get_local $1)
@@ -199,12 +199,12 @@
(f64.const 12.34)
)
)
- (func $call1 (; 10 ;) (param $0 i64) (result i64)
+ (func $call1 (; 10 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(call $call1
(get_local $0)
)
)
- (func $call2 (; 11 ;) (param $0 i64) (result i64)
+ (func $call2 (; 11 ;) (; has Stack IR ;) (param $0 i64) (result i64)
(drop
(call $call2
(call $call2
@@ -214,13 +214,13 @@
)
(i64.const 245127260211081)
)
- (func $ifValue32 (; 12 ;) (param $0 i32) (param $1 i32) (result i32)
+ (func $ifValue32 (; 12 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
(call $ifValue32
(get_local $0)
(get_local $1)
)
)
- (func $switch64 (; 13 ;) (param $0 i64) (result i32)
+ (func $switch64 (; 13 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(block $switch (result i32)
(block $switch-default
(block $switch-case0
@@ -255,7 +255,7 @@
(i32.const 1)
)
)
- (func $unreachable_leftovers (; 14 ;) (param $0 i32) (param $1 i32) (param $2 i32)
+ (func $unreachable_leftovers (; 14 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32)
(block $__rjto$0
(if
(i32.eqz
@@ -278,7 +278,7 @@
)
)
)
- (func $switch64TOOMUCH (; 15 ;) (param $0 i64) (result i32)
+ (func $switch64TOOMUCH (; 15 ;) (; has Stack IR ;) (param $0 i64) (result i32)
(local $1 i32)
(local $2 i64)
(block $switch-default
@@ -355,7 +355,7 @@
)
(i32.const 44)
)
- (func $_memchr (; 16 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
+ (func $_memchr (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@@ -586,7 +586,7 @@
(get_local $0)
)
)
- (func $keepAlive (; 17 ;)
+ (func $keepAlive (; 17 ;) (; has Stack IR ;)
(call $stores)
(call $stores)
(call $test)
@@ -678,7 +678,7 @@
)
)
)
- (func $legalstub$illegalParam (; 18 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
+ (func $legalstub$illegalParam (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
(call $illegalParam
(get_local $0)
(i64.or
@@ -695,13 +695,13 @@
(get_local $3)
)
)
- (func $legalstub$illegalResult (; 19 ;) (result i32)
+ (func $legalstub$illegalResult (; 19 ;) (; has Stack IR ;) (result i32)
(set_global $tempRet0
(i32.const 2)
)
(i32.const 1)
)
- (func $legalfunc$illegalImport (; 20 ;) (param $0 f64) (param $1 i64) (param $2 i32)
+ (func $legalfunc$illegalImport (; 20 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32)
(call $legalimport$illegalImport
(get_local $0)
(i32.wrap/i64
@@ -716,7 +716,7 @@
(get_local $2)
)
)
- (func $legalfunc$_fabsf (; 21 ;) (param $0 f32) (result f32)
+ (func $legalfunc$_fabsf (; 21 ;) (; has Stack IR ;) (param $0 f32) (result f32)
(f32.demote/f64
(call $legalimport$_fabsf
(f64.promote/f32
@@ -725,7 +725,7 @@
)
)
)
- (func $legalfunc$do_i64 (; 22 ;) (result i64)
+ (func $legalfunc$do_i64 (; 22 ;) (; has Stack IR ;) (result i64)
(i64.or
(i64.extend_u/i32
(call $legalimport$do_i64)
@@ -738,10 +738,10 @@
)
)
)
- (func $getTempRet0 (; 23 ;) (result i32)
+ (func $getTempRet0 (; 23 ;) (; has Stack IR ;) (result i32)
(get_global $tempRet0)
)
- (func $setTempRet0 (; 24 ;) (param $0 i32)
+ (func $setTempRet0 (; 24 ;) (; has Stack IR ;) (param $0 i32)
(set_global $tempRet0
(get_local $0)
)