diff options
-rw-r--r-- | src/passes/pass.cpp | 5 | ||||
-rw-r--r-- | test/emcc_O2_hello_world.fromasm | 627 | ||||
-rw-r--r-- | test/emcc_O2_hello_world.fromasm.clamp | 627 | ||||
-rw-r--r-- | test/emcc_O2_hello_world.fromasm.imprecise | 529 | ||||
-rw-r--r-- | test/emcc_hello_world.fromasm | 1086 | ||||
-rw-r--r-- | test/emcc_hello_world.fromasm.clamp | 1086 | ||||
-rw-r--r-- | test/emcc_hello_world.fromasm.imprecise | 1085 | ||||
-rw-r--r-- | test/memorygrowth.fromasm | 597 | ||||
-rw-r--r-- | test/memorygrowth.fromasm.clamp | 597 | ||||
-rw-r--r-- | test/memorygrowth.fromasm.imprecise | 497 | ||||
-rw-r--r-- | test/passes/O.txt | 38 | ||||
-rw-r--r-- | test/passes/O.wast | 18 | ||||
-rw-r--r-- | test/passes/inlining-optimizing_optimize-level=3.txt | 50 | ||||
-rw-r--r-- | test/unit.fromasm | 12 | ||||
-rw-r--r-- | test/unit.fromasm.clamp | 12 | ||||
-rw-r--r-- | test/unit.fromasm.imprecise | 12 | ||||
-rw-r--r-- | test/wasm-only.fromasm | 63 | ||||
-rw-r--r-- | test/wasm-only.fromasm.clamp | 63 | ||||
-rw-r--r-- | test/wasm-only.fromasm.imprecise | 50 |
19 files changed, 3435 insertions, 3619 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index e89fed83f..c42a3d144 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -180,8 +180,11 @@ void PassRunner::addDefaultFunctionOptimizationPasses() { } add("coalesce-locals"); add("simplify-locals"); - add("vacuum"); // previous pass creates garbage + add("vacuum"); + add("reorder-locals"); + add("coalesce-locals"); add("reorder-locals"); + add("vacuum"); if (options.optimizeLevel >= 3 || options.shrinkLevel >= 1) { add("code-folding"); } diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm index 637486547..9353b7716 100644 --- a/test/emcc_O2_hello_world.fromasm +++ b/test/emcc_O2_hello_world.fromasm @@ -7652,7 +7652,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7661,13 +7661,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7680,7 +7680,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7690,7 +7690,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7708,7 +7708,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7723,7 +7723,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7742,51 +7742,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $_pthread_cleanup_pop (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7818,7 +7818,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7863,7 +7863,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7913,7 +7913,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7930,7 +7930,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7940,9 +7940,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8018,7 +8016,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8032,7 +8030,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8043,164 +8041,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$L5 (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$L5 - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + (get_local $1) + ) + (br $label$break$L5 + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$L10 + (set_local $3 + (get_local $1) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$L10) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$L10) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$L5 - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + ) + (drop + (br_if $label$break$L5 + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) (get_local $3) ) ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) - ) - ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $_memcpy - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $_memcpy + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8263,9 +8259,6 @@ (get_local $2) ) ) - (set_local $0 - (i32.const 0) - ) (if (i32.gt_u (i32.load offset=20 @@ -8593,119 +8586,117 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (tee_local $0 + (if (result i32) (if (result i32) - (if (result i32) - (i32.gt_u - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.gt_u + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) - (block (result i32) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $0) - ) - (i32.const 7) + ) + (block (result i32) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) - (i32.eqz - (i32.load - (get_local $1) - ) + ) + (i32.eqz + (i32.load + (get_local $1) ) ) - (i32.const 0) ) - (i32.const -1) - (block (result i32) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) + (i32.const 0) + ) + (i32.const -1) + (block (result i32) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (i32.load offset=40 - (get_local $0) - ) - (i32.const 7) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (i32.load offset=40 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) + (i32.const 0) + ) + (i32.store + (get_local $2) (i32.const 0) ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.store + (get_local $5) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (i32.const 0) ) ) ) @@ -9012,71 +9003,69 @@ ) (i32.shr_s (i32.shl - (tee_local $0 - (if (result i32) - (i32.lt_s - (i32.add - (call $_fwrite + (if (result i32) + (i32.lt_s + (i32.add + (call $_fwrite + (i32.const 672) + (call $_strlen (i32.const 672) - (call $_strlen - (i32.const 672) - ) - (get_local $0) ) - (i32.const -1) + (get_local $0) ) - (i32.const 0) + (i32.const -1) ) - (i32.const 1) - (block $do-once (result i32) - (if - (if (result i32) - (i32.ne - (i32.load8_s offset=75 - (get_local $0) - ) - (i32.const 10) + (i32.const 0) + ) + (i32.const 1) + (block $do-once (result i32) + (if + (if (result i32) + (i32.ne + (i32.load8_s offset=75 + (get_local $0) ) - (i32.lt_u - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.const 10) + ) + (i32.lt_u + (tee_local $1 + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) ) - (i32.load offset=16 - (get_local $0) - ) ) - (i32.const 0) - ) - (block - (i32.store - (get_local $2) - (i32.add - (get_local $1) - (i32.const 1) - ) + (i32.load offset=16 + (get_local $0) ) - (i32.store8 + ) + (i32.const 0) + ) + (block + (i32.store + (get_local $2) + (i32.add (get_local $1) - (i32.const 10) - ) - (br $do-once - (i32.const 0) + (i32.const 1) ) ) - ) - (i32.lt_s - (call $___overflow - (get_local $0) + (i32.store8 + (get_local $1) + (i32.const 10) ) - (i32.const 0) + (br $do-once + (i32.const 0) + ) + ) + ) + (i32.lt_s + (call $___overflow + (get_local $0) ) + (i32.const 0) ) ) ) @@ -9177,58 +9166,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/emcc_O2_hello_world.fromasm.clamp b/test/emcc_O2_hello_world.fromasm.clamp index 637486547..9353b7716 100644 --- a/test/emcc_O2_hello_world.fromasm.clamp +++ b/test/emcc_O2_hello_world.fromasm.clamp @@ -7652,7 +7652,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7661,13 +7661,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7680,7 +7680,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7690,7 +7690,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7708,7 +7708,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7723,7 +7723,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7742,51 +7742,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $_pthread_cleanup_pop (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7818,7 +7818,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7863,7 +7863,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7913,7 +7913,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7930,7 +7930,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7940,9 +7940,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8018,7 +8016,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8032,7 +8030,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8043,164 +8041,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$L5 (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$L5 - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + (get_local $1) + ) + (br $label$break$L5 + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$L10 + (set_local $3 + (get_local $1) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$L10) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$L10) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$L5 - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + ) + (drop + (br_if $label$break$L5 + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) (get_local $3) ) ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) - ) - ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $_memcpy - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $_memcpy + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8263,9 +8259,6 @@ (get_local $2) ) ) - (set_local $0 - (i32.const 0) - ) (if (i32.gt_u (i32.load offset=20 @@ -8593,119 +8586,117 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (tee_local $0 + (if (result i32) (if (result i32) - (if (result i32) - (i32.gt_u - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.gt_u + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) - (block (result i32) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $0) - ) - (i32.const 7) + ) + (block (result i32) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) - (i32.eqz - (i32.load - (get_local $1) - ) + ) + (i32.eqz + (i32.load + (get_local $1) ) ) - (i32.const 0) ) - (i32.const -1) - (block (result i32) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) + (i32.const 0) + ) + (i32.const -1) + (block (result i32) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (i32.load offset=40 - (get_local $0) - ) - (i32.const 7) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (i32.load offset=40 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) + (i32.const 0) + ) + (i32.store + (get_local $2) (i32.const 0) ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.store + (get_local $5) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (i32.const 0) ) ) ) @@ -9012,71 +9003,69 @@ ) (i32.shr_s (i32.shl - (tee_local $0 - (if (result i32) - (i32.lt_s - (i32.add - (call $_fwrite + (if (result i32) + (i32.lt_s + (i32.add + (call $_fwrite + (i32.const 672) + (call $_strlen (i32.const 672) - (call $_strlen - (i32.const 672) - ) - (get_local $0) ) - (i32.const -1) + (get_local $0) ) - (i32.const 0) + (i32.const -1) ) - (i32.const 1) - (block $do-once (result i32) - (if - (if (result i32) - (i32.ne - (i32.load8_s offset=75 - (get_local $0) - ) - (i32.const 10) + (i32.const 0) + ) + (i32.const 1) + (block $do-once (result i32) + (if + (if (result i32) + (i32.ne + (i32.load8_s offset=75 + (get_local $0) ) - (i32.lt_u - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.const 10) + ) + (i32.lt_u + (tee_local $1 + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) ) - (i32.load offset=16 - (get_local $0) - ) ) - (i32.const 0) - ) - (block - (i32.store - (get_local $2) - (i32.add - (get_local $1) - (i32.const 1) - ) + (i32.load offset=16 + (get_local $0) ) - (i32.store8 + ) + (i32.const 0) + ) + (block + (i32.store + (get_local $2) + (i32.add (get_local $1) - (i32.const 10) - ) - (br $do-once - (i32.const 0) + (i32.const 1) ) ) - ) - (i32.lt_s - (call $___overflow - (get_local $0) + (i32.store8 + (get_local $1) + (i32.const 10) ) - (i32.const 0) + (br $do-once + (i32.const 0) + ) + ) + ) + (i32.lt_s + (call $___overflow + (get_local $0) ) + (i32.const 0) ) ) ) @@ -9177,58 +9166,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise index 8df23c84e..50a771da2 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise +++ b/test/emcc_O2_hello_world.fromasm.imprecise @@ -7651,7 +7651,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7660,13 +7660,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7679,7 +7679,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7689,7 +7689,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7707,7 +7707,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7722,7 +7722,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7741,51 +7741,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $_pthread_cleanup_pop (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $___syscall_ret (call $___syscall146 (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7817,7 +7817,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7862,7 +7862,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7912,7 +7912,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7931,7 +7931,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7941,9 +7941,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8014,7 +8012,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8028,7 +8026,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8039,164 +8037,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$L5 (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$L5 - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + (get_local $1) + ) + (br $label$break$L5 + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$L10 + (set_local $3 + (get_local $1) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$L10) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$L10) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$L5 - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 7) + ) + (drop + (br_if $label$break$L5 + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) - ) - ) - (set_local $0 - (i32.add - (get_local $0) (get_local $3) ) ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $_memcpy - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $_memcpy + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8254,9 +8250,6 @@ (get_local $0) ) (loop $while-in - (set_local $0 - (i32.const 0) - ) (if (i32.gt_u (i32.load offset=20 @@ -8584,119 +8577,117 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (tee_local $0 + (if (result i32) (if (result i32) - (if (result i32) - (i32.gt_u - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.gt_u + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) - (block (result i32) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $0) - ) - (i32.const 7) + ) + (block (result i32) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) - (i32.eqz - (i32.load - (get_local $1) - ) + ) + (i32.eqz + (i32.load + (get_local $1) ) ) - (i32.const 0) ) - (i32.const -1) - (block (result i32) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 4) - ) + (i32.const 0) + ) + (i32.const -1) + (block (result i32) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (i32.load offset=40 - (get_local $0) - ) - (i32.const 7) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (i32.load offset=40 + (get_local $0) ) - (i32.const 2) + (i32.const 7) ) + (i32.const 2) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) (i32.const 0) ) + (i32.store + (get_local $2) + (i32.const 0) + ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.store + (get_local $5) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (i32.const 0) ) ) ) @@ -9185,58 +9176,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index e7fbb92a8..08d4aa13c 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -172,22 +172,20 @@ (block $switch-default (if (tee_local $5 - (tee_local $3 + (tee_local $4 (i32.and - (tee_local $3 - (call $_bitshift64Lshr - (tee_local $2 - (i32.load - (get_global $tempDoublePtr) - ) + (call $_bitshift64Lshr + (tee_local $2 + (i32.load + (get_global $tempDoublePtr) ) - (tee_local $4 - (i32.load offset=4 - (get_global $tempDoublePtr) - ) + ) + (tee_local $3 + (i32.load offset=4 + (get_global $tempDoublePtr) ) - (i32.const 52) ) + (i32.const 52) ) (i32.const 2047) ) @@ -204,31 +202,29 @@ ) (i32.store (get_local $1) - (tee_local $2 - (if (result i32) - (f64.ne - (get_local $0) - (f64.const 0) - ) - (block (result i32) - (set_local $0 - (call $_frexp - (f64.mul - (get_local $0) - (f64.const 18446744073709551615) - ) - (get_local $1) + (if (result i32) + (f64.ne + (get_local $0) + (f64.const 0) + ) + (block (result i32) + (set_local $0 + (call $_frexp + (f64.mul + (get_local $0) + (f64.const 18446744073709551615) ) + (get_local $1) ) - (i32.add - (i32.load - (get_local $1) - ) - (i32.const -64) + ) + (i32.add + (i32.load + (get_local $1) ) + (i32.const -64) ) - (i32.const 0) ) + (i32.const 0) ) ) (br $switch) @@ -236,7 +232,7 @@ (i32.store (get_local $1) (i32.add - (get_local $3) + (get_local $4) (i32.const -1022) ) ) @@ -248,7 +244,7 @@ (get_global $tempDoublePtr) (i32.or (i32.and - (get_local $4) + (get_local $3) (i32.const -2146435073) ) (i32.const 1071644672) @@ -546,7 +542,6 @@ ) (func $_fflush (; 33 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) (if (get_local $0) (set_local $0 @@ -1025,7 +1020,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) (set_local $3 (get_global $STACKTOP) ) @@ -1503,58 +1497,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $1 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $1 + (i32.load (get_local $0) - (i32.or - (get_local $1) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $1) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (get_local $1) - (i32.load offset=48 - (get_local $0) - ) + (i32.load offset=48 + (get_local $0) ) ) - (i32.const 0) ) + (i32.const 0) ) ) ) @@ -1960,127 +1952,125 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (tee_local $0 - (block $__rjto$0 (result i32) - (block $__rjti$0 - (br_if $__rjti$0 - (i32.le_u - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (block $__rjto$0 (result i32) + (block $__rjti$0 + (br_if $__rjti$0 + (i32.le_u + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) ) - (set_local $1 - (i32.load offset=36 - (get_local $0) - ) + ) + (set_local $1 + (i32.load offset=36 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (get_local $1) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (get_local $1) + (i32.const 7) ) + (i32.const 2) ) ) - (br_if $__rjti$0 - (i32.load - (get_local $2) - ) - ) - (br $__rjto$0 - (i32.const -1) + ) + (br_if $__rjti$0 + (i32.load + (get_local $2) ) ) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 4) - ) + (br $__rjto$0 + (i32.const -1) + ) + ) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (block - (set_local $7 - (i32.load offset=40 - (get_local $0) - ) + ) + (block + (set_local $7 + (i32.load offset=40 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (get_local $7) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (get_local $7) + (i32.const 7) ) + (i32.const 2) ) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) + (i32.const 0) + ) + (i32.store + (get_local $3) (i32.const 0) ) + (i32.store + (get_local $2) + (i32.const 0) + ) + (i32.store + (get_local $5) + (i32.const 0) + ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.const 0) ) ) (func $_cleanup (; 44 ;) (; has Stack IR ;) (param $0 i32) @@ -5936,13 +5926,13 @@ (call $_pad (get_local $0) (i32.const 48) - (block (result i32) - (if + (i32.add + (if (result i32) (i32.gt_s (get_local $5) (i32.const -1) ) - (block + (block (result i32) (set_local $18 (i32.eqz (get_local $21) @@ -6113,15 +6103,11 @@ ) ) ) - (set_local $5 - (get_local $7) - ) + (get_local $7) ) - ) - (i32.add (get_local $5) - (i32.const 18) ) + (i32.const 18) ) (i32.const 18) (i32.const 0) @@ -6213,9 +6199,9 @@ ) ) (if - (block (result i32) - (if - (i32.eqz + (i32.eqz + (i32.and + (if (result i32) (i32.and (tee_local $5 (i32.load @@ -6224,27 +6210,21 @@ ) (i32.const 32) ) - ) - (block - (drop - (call $___fwritex - (get_local $30) - (get_local $9) - (get_local $0) + (get_local $5) + (block (result i32) + (drop + (call $___fwritex + (get_local $30) + (get_local $9) + (get_local $0) + ) ) - ) - (set_local $5 (i32.load (get_local $0) ) ) ) - ) - (i32.eqz - (i32.and - (get_local $5) - (i32.const 32) - ) + (i32.const 32) ) ) (drop @@ -7347,12 +7327,10 @@ ) ) (i32.or - (tee_local $3 - (call $___uremdi3 - (get_local $0) - (get_local $1) - (i32.const 10) - ) + (call $___uremdi3 + (get_local $0) + (get_local $1) + (i32.const 10) ) (i32.const 48) ) @@ -11189,494 +11167,492 @@ (i32.store (tee_local $0 (i32.add - (tee_local $0 - (if (result i32) - (i32.eq - (i32.and - (tee_local $0 - (i32.load offset=4 - (get_local $6) - ) + (if (result i32) + (i32.eq + (i32.and + (tee_local $0 + (i32.load offset=4 + (get_local $6) ) - (i32.const 3) ) - (i32.const 1) + (i32.const 3) ) - (block (result i32) - (set_local $10 - (i32.and - (get_local $0) - (i32.const -8) - ) + (i32.const 1) + ) + (block (result i32) + (set_local $10 + (i32.and + (get_local $0) + (i32.const -8) ) - (set_local $1 - (i32.shr_u + ) + (set_local $1 + (i32.shr_u + (get_local $0) + (i32.const 3) + ) + ) + (block $label$break$L331 + (if + (i32.lt_u (get_local $0) - (i32.const 3) + (i32.const 256) ) - ) - (block $label$break$L331 - (if - (i32.lt_u - (get_local $0) - (i32.const 256) + (block + (set_local $2 + (i32.load offset=12 + (get_local $6) + ) ) - (block - (set_local $2 - (i32.load offset=12 - (get_local $6) + (if + (i32.ne + (tee_local $3 + (i32.load offset=8 + (get_local $6) + ) ) - ) - (if - (i32.ne - (tee_local $3 - (i32.load offset=8 - (get_local $6) + (tee_local $0 + (i32.add + (i32.shl + (get_local $1) + (i32.const 3) ) + (i32.const 216) ) - (tee_local $0 - (i32.add - (i32.shl - (get_local $1) - (i32.const 3) - ) - (i32.const 216) - ) + ) + ) + (block $do-once51 + (if + (i32.lt_u + (get_local $3) + (get_local $4) ) + (call $_abort) ) - (block $do-once51 - (if - (i32.lt_u + (br_if $do-once51 + (i32.eq + (i32.load offset=12 (get_local $3) - (get_local $4) - ) - (call $_abort) - ) - (br_if $do-once51 - (i32.eq - (i32.load offset=12 - (get_local $3) - ) - (get_local $6) ) + (get_local $6) ) - (call $_abort) ) + (call $_abort) ) - (if - (i32.eq - (get_local $2) - (get_local $3) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (i32.load - (i32.const 176) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) - ) - (i32.const -1) + ) + (if + (i32.eq + (get_local $2) + (get_local $3) + ) + (block + (i32.store + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) - (br $label$break$L331) ) + (br $label$break$L331) ) - (if - (i32.eq - (get_local $0) + ) + (if + (i32.eq + (get_local $0) + (get_local $2) + ) + (set_local $15 + (i32.add (get_local $2) + (i32.const 8) ) - (set_local $15 - (i32.add + ) + (block $do-once53 + (if + (i32.lt_u (get_local $2) - (i32.const 8) + (get_local $4) ) + (call $_abort) ) - (block $do-once53 - (if - (i32.lt_u - (get_local $2) - (get_local $4) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $2) - (i32.const 8) - ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $2) + (i32.const 8) ) ) - (get_local $6) ) - (block - (set_local $15 - (get_local $0) - ) - (br $do-once53) + (get_local $6) + ) + (block + (set_local $15 + (get_local $0) ) + (br $do-once53) ) - (call $_abort) ) - ) - (i32.store offset=12 - (get_local $3) - (get_local $2) - ) - (i32.store - (get_local $15) - (get_local $3) + (call $_abort) ) ) - (block - (set_local $5 - (i32.load offset=24 - (get_local $6) - ) + (i32.store offset=12 + (get_local $3) + (get_local $2) + ) + (i32.store + (get_local $15) + (get_local $3) + ) + ) + (block + (set_local $5 + (i32.load offset=24 + (get_local $6) ) - (if - (i32.eq - (tee_local $0 - (i32.load offset=12 - (get_local $6) - ) + ) + (if + (i32.eq + (tee_local $0 + (i32.load offset=12 + (get_local $6) ) - (get_local $6) ) - (block $do-once55 - (if - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $0 - (i32.add - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) - ) + (get_local $6) + ) + (block $do-once55 + (if + (i32.eqz + (tee_local $1 + (i32.load + (tee_local $0 + (i32.add + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) ) - (i32.const 4) ) + (i32.const 4) ) ) ) ) - (block - (br_if $do-once55 - (i32.eqz - (tee_local $1 - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $0 - (get_local $3) - ) - ) ) - (loop $while-in58 - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) - ) - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 16) - ) + (block + (br_if $do-once55 + (i32.eqz + (tee_local $1 + (i32.load + (get_local $3) ) ) ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) - ) - ) - (if - (i32.lt_u - (get_local $0) - (get_local $4) ) - (call $_abort) - (block - (i32.store - (get_local $0) - (i32.const 0) - ) - (set_local $8 - (get_local $1) - ) + (set_local $0 + (get_local $3) ) ) ) - (block - (if - (i32.lt_u - (tee_local $2 - (i32.load offset=8 - (get_local $6) - ) - ) - (get_local $4) - ) - (call $_abort) - ) + (loop $while-in58 (if - (i32.ne - (get_local $6) + (tee_local $3 (i32.load - (tee_local $3 + (tee_local $2 (i32.add - (get_local $2) - (i32.const 12) + (get_local $1) + (i32.const 20) ) ) ) ) - (call $_abort) + (block + (set_local $1 + (get_local $3) + ) + (set_local $0 + (get_local $2) + ) + (br $while-in58) + ) ) (if - (i32.eq + (tee_local $3 (i32.load - (tee_local $1 + (tee_local $2 (i32.add - (get_local $0) - (i32.const 8) + (get_local $1) + (i32.const 16) ) ) ) - (get_local $6) ) (block - (i32.store + (set_local $1 (get_local $3) - (get_local $0) ) - (i32.store - (get_local $1) + (set_local $0 (get_local $2) ) - (set_local $8 - (get_local $0) - ) + (br $while-in58) ) - (call $_abort) ) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $5) + (if + (i32.lt_u + (get_local $0) + (get_local $4) + ) + (call $_abort) + (block + (i32.store + (get_local $0) + (i32.const 0) + ) + (set_local $8 + (get_local $1) + ) + ) ) ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (i32.shl - (tee_local $1 - (i32.load offset=28 - (get_local $6) - ) - ) - (i32.const 2) - ) - (i32.const 480) + (block + (if + (i32.lt_u + (tee_local $2 + (i32.load offset=8 + (get_local $6) ) ) + (get_local $4) ) - (get_local $6) + (call $_abort) ) - (block $do-once59 - (i32.store - (get_local $0) - (get_local $8) - ) - (br_if $do-once59 - (get_local $8) - ) - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) + (if + (i32.ne + (get_local $6) + (i32.load + (tee_local $3 + (i32.add + (get_local $2) + (i32.const 12) ) - (i32.const -1) ) ) ) - (br $label$break$L331) + (call $_abort) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $5) - (i32.const 16) - ) + (if + (i32.eq + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 8) ) ) - (get_local $6) ) + (get_local $6) + ) + (block (i32.store + (get_local $3) (get_local $0) - (get_local $8) ) - (i32.store offset=20 - (get_local $5) - (get_local $8) + (i32.store + (get_local $1) + (get_local $2) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $8) + (set_local $8 + (get_local $0) ) ) + (call $_abort) ) ) - (if - (i32.lt_u - (get_local $8) - (tee_local $1 - (i32.load - (i32.const 192) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $5) + ) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (i32.shl + (tee_local $1 + (i32.load offset=28 + (get_local $6) + ) + ) + (i32.const 2) + ) + (i32.const 480) ) ) ) - (call $_abort) - ) - (i32.store offset=24 - (get_local $8) - (get_local $5) + (get_local $6) ) - (if - (tee_local $3 - (i32.load - (tee_local $0 - (i32.add - (get_local $6) - (i32.const 16) + (block $do-once59 + (i32.store + (get_local $0) + (get_local $8) + ) + (br_if $do-once59 + (get_local $8) + ) + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) ) + (br $label$break$L331) + ) + (block (if (i32.lt_u - (get_local $3) - (get_local $1) + (get_local $5) + (i32.load + (i32.const 192) + ) ) (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $3) - ) - (i32.store offset=24 - (get_local $3) - (get_local $8) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $5) + (i32.const 16) + ) + ) ) + (get_local $6) + ) + (i32.store + (get_local $0) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) + ) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $8) ) ) ) - (br_if $label$break$L331 - (i32.eqz + ) + (if + (i32.lt_u + (get_local $8) + (tee_local $1 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $3 + (i32.load (tee_local $0 - (i32.load offset=4 - (get_local $0) + (i32.add + (get_local $6) + (i32.const 16) ) ) ) ) (if (i32.lt_u - (get_local $0) - (i32.load - (i32.const 192) - ) + (get_local $3) + (get_local $1) ) (call $_abort) (block - (i32.store offset=20 + (i32.store offset=16 (get_local $8) - (get_local $0) + (get_local $3) ) (i32.store offset=24 - (get_local $0) + (get_local $3) (get_local $8) ) ) ) ) + (br_if $label$break$L331 + (i32.eqz + (tee_local $0 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + (if + (i32.lt_u + (get_local $0) + (i32.load + (i32.const 192) + ) + ) + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) + (get_local $0) + ) + (i32.store offset=24 + (get_local $0) + (get_local $8) + ) + ) + ) ) ) - (set_local $7 - (i32.add - (get_local $7) - (get_local $10) - ) - ) + ) + (set_local $7 (i32.add - (get_local $6) + (get_local $7) (get_local $10) ) ) - (get_local $6) + (i32.add + (get_local $6) + (get_local $10) + ) ) + (get_local $6) ) (i32.const 4) ) diff --git a/test/emcc_hello_world.fromasm.clamp b/test/emcc_hello_world.fromasm.clamp index a6d85be58..21785eb27 100644 --- a/test/emcc_hello_world.fromasm.clamp +++ b/test/emcc_hello_world.fromasm.clamp @@ -170,22 +170,20 @@ (block $switch-default (if (tee_local $5 - (tee_local $3 + (tee_local $4 (i32.and - (tee_local $3 - (call $_bitshift64Lshr - (tee_local $2 - (i32.load - (get_global $tempDoublePtr) - ) + (call $_bitshift64Lshr + (tee_local $2 + (i32.load + (get_global $tempDoublePtr) ) - (tee_local $4 - (i32.load offset=4 - (get_global $tempDoublePtr) - ) + ) + (tee_local $3 + (i32.load offset=4 + (get_global $tempDoublePtr) ) - (i32.const 52) ) + (i32.const 52) ) (i32.const 2047) ) @@ -202,31 +200,29 @@ ) (i32.store (get_local $1) - (tee_local $2 - (if (result i32) - (f64.ne - (get_local $0) - (f64.const 0) - ) - (block (result i32) - (set_local $0 - (call $_frexp - (f64.mul - (get_local $0) - (f64.const 18446744073709551615) - ) - (get_local $1) + (if (result i32) + (f64.ne + (get_local $0) + (f64.const 0) + ) + (block (result i32) + (set_local $0 + (call $_frexp + (f64.mul + (get_local $0) + (f64.const 18446744073709551615) ) + (get_local $1) ) - (i32.add - (i32.load - (get_local $1) - ) - (i32.const -64) + ) + (i32.add + (i32.load + (get_local $1) ) + (i32.const -64) ) - (i32.const 0) ) + (i32.const 0) ) ) (br $switch) @@ -234,7 +230,7 @@ (i32.store (get_local $1) (i32.add - (get_local $3) + (get_local $4) (i32.const -1022) ) ) @@ -246,7 +242,7 @@ (get_global $tempDoublePtr) (i32.or (i32.and - (get_local $4) + (get_local $3) (i32.const -2146435073) ) (i32.const 1071644672) @@ -544,7 +540,6 @@ ) (func $_fflush (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) (if (get_local $0) (set_local $0 @@ -1023,7 +1018,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) (set_local $3 (get_global $STACKTOP) ) @@ -1501,58 +1495,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $1 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $1 + (i32.load (get_local $0) - (i32.or - (get_local $1) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $1) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (get_local $1) - (i32.load offset=48 - (get_local $0) - ) + (i32.load offset=48 + (get_local $0) ) ) - (i32.const 0) ) + (i32.const 0) ) ) ) @@ -1958,127 +1950,125 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (tee_local $0 - (block $__rjto$0 (result i32) - (block $__rjti$0 - (br_if $__rjti$0 - (i32.le_u - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (block $__rjto$0 (result i32) + (block $__rjti$0 + (br_if $__rjti$0 + (i32.le_u + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) ) - (set_local $1 - (i32.load offset=36 - (get_local $0) - ) + ) + (set_local $1 + (i32.load offset=36 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (get_local $1) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (get_local $1) + (i32.const 7) ) + (i32.const 2) ) ) - (br_if $__rjti$0 - (i32.load - (get_local $2) - ) - ) - (br $__rjto$0 - (i32.const -1) + ) + (br_if $__rjti$0 + (i32.load + (get_local $2) ) ) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 4) - ) + (br $__rjto$0 + (i32.const -1) + ) + ) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (block - (set_local $7 - (i32.load offset=40 - (get_local $0) - ) + ) + (block + (set_local $7 + (i32.load offset=40 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (get_local $7) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (get_local $7) + (i32.const 7) ) + (i32.const 2) ) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) + (i32.const 0) + ) + (i32.store + (get_local $3) (i32.const 0) ) + (i32.store + (get_local $2) + (i32.const 0) + ) + (i32.store + (get_local $5) + (i32.const 0) + ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.const 0) ) ) (func $_cleanup (; 43 ;) (; has Stack IR ;) (param $0 i32) @@ -5986,13 +5976,13 @@ (call $_pad (get_local $0) (i32.const 48) - (block (result i32) - (if + (i32.add + (if (result i32) (i32.gt_s (get_local $5) (i32.const -1) ) - (block + (block (result i32) (set_local $18 (i32.eqz (get_local $21) @@ -6163,15 +6153,11 @@ ) ) ) - (set_local $5 - (get_local $7) - ) + (get_local $7) ) - ) - (i32.add (get_local $5) - (i32.const 18) ) + (i32.const 18) ) (i32.const 18) (i32.const 0) @@ -6263,9 +6249,9 @@ ) ) (if - (block (result i32) - (if - (i32.eqz + (i32.eqz + (i32.and + (if (result i32) (i32.and (tee_local $5 (i32.load @@ -6274,27 +6260,21 @@ ) (i32.const 32) ) - ) - (block - (drop - (call $___fwritex - (get_local $30) - (get_local $9) - (get_local $0) + (get_local $5) + (block (result i32) + (drop + (call $___fwritex + (get_local $30) + (get_local $9) + (get_local $0) + ) ) - ) - (set_local $5 (i32.load (get_local $0) ) ) ) - ) - (i32.eqz - (i32.and - (get_local $5) - (i32.const 32) - ) + (i32.const 32) ) ) (drop @@ -7397,12 +7377,10 @@ ) ) (i32.or - (tee_local $3 - (call $___uremdi3 - (get_local $0) - (get_local $1) - (i32.const 10) - ) + (call $___uremdi3 + (get_local $0) + (get_local $1) + (i32.const 10) ) (i32.const 48) ) @@ -11239,494 +11217,492 @@ (i32.store (tee_local $0 (i32.add - (tee_local $0 - (if (result i32) - (i32.eq - (i32.and - (tee_local $0 - (i32.load offset=4 - (get_local $6) - ) + (if (result i32) + (i32.eq + (i32.and + (tee_local $0 + (i32.load offset=4 + (get_local $6) ) - (i32.const 3) ) - (i32.const 1) + (i32.const 3) ) - (block (result i32) - (set_local $10 - (i32.and - (get_local $0) - (i32.const -8) - ) + (i32.const 1) + ) + (block (result i32) + (set_local $10 + (i32.and + (get_local $0) + (i32.const -8) ) - (set_local $1 - (i32.shr_u + ) + (set_local $1 + (i32.shr_u + (get_local $0) + (i32.const 3) + ) + ) + (block $label$break$L331 + (if + (i32.lt_u (get_local $0) - (i32.const 3) + (i32.const 256) ) - ) - (block $label$break$L331 - (if - (i32.lt_u - (get_local $0) - (i32.const 256) + (block + (set_local $2 + (i32.load offset=12 + (get_local $6) + ) ) - (block - (set_local $2 - (i32.load offset=12 - (get_local $6) + (if + (i32.ne + (tee_local $3 + (i32.load offset=8 + (get_local $6) + ) ) - ) - (if - (i32.ne - (tee_local $3 - (i32.load offset=8 - (get_local $6) + (tee_local $0 + (i32.add + (i32.shl + (get_local $1) + (i32.const 3) ) + (i32.const 216) ) - (tee_local $0 - (i32.add - (i32.shl - (get_local $1) - (i32.const 3) - ) - (i32.const 216) - ) + ) + ) + (block $do-once51 + (if + (i32.lt_u + (get_local $3) + (get_local $4) ) + (call $_abort) ) - (block $do-once51 - (if - (i32.lt_u + (br_if $do-once51 + (i32.eq + (i32.load offset=12 (get_local $3) - (get_local $4) - ) - (call $_abort) - ) - (br_if $do-once51 - (i32.eq - (i32.load offset=12 - (get_local $3) - ) - (get_local $6) ) + (get_local $6) ) - (call $_abort) ) + (call $_abort) ) - (if - (i32.eq - (get_local $2) - (get_local $3) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (i32.load - (i32.const 176) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) - ) - (i32.const -1) + ) + (if + (i32.eq + (get_local $2) + (get_local $3) + ) + (block + (i32.store + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) - (br $label$break$L331) ) + (br $label$break$L331) ) - (if - (i32.eq - (get_local $0) + ) + (if + (i32.eq + (get_local $0) + (get_local $2) + ) + (set_local $15 + (i32.add (get_local $2) + (i32.const 8) ) - (set_local $15 - (i32.add + ) + (block $do-once53 + (if + (i32.lt_u (get_local $2) - (i32.const 8) + (get_local $4) ) + (call $_abort) ) - (block $do-once53 - (if - (i32.lt_u - (get_local $2) - (get_local $4) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $2) - (i32.const 8) - ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $2) + (i32.const 8) ) ) - (get_local $6) ) - (block - (set_local $15 - (get_local $0) - ) - (br $do-once53) + (get_local $6) + ) + (block + (set_local $15 + (get_local $0) ) + (br $do-once53) ) - (call $_abort) ) - ) - (i32.store offset=12 - (get_local $3) - (get_local $2) - ) - (i32.store - (get_local $15) - (get_local $3) + (call $_abort) ) ) - (block - (set_local $5 - (i32.load offset=24 - (get_local $6) - ) + (i32.store offset=12 + (get_local $3) + (get_local $2) + ) + (i32.store + (get_local $15) + (get_local $3) + ) + ) + (block + (set_local $5 + (i32.load offset=24 + (get_local $6) ) - (if - (i32.eq - (tee_local $0 - (i32.load offset=12 - (get_local $6) - ) + ) + (if + (i32.eq + (tee_local $0 + (i32.load offset=12 + (get_local $6) ) - (get_local $6) ) - (block $do-once55 - (if - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $0 - (i32.add - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) - ) + (get_local $6) + ) + (block $do-once55 + (if + (i32.eqz + (tee_local $1 + (i32.load + (tee_local $0 + (i32.add + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) ) - (i32.const 4) ) + (i32.const 4) ) ) ) ) - (block - (br_if $do-once55 - (i32.eqz - (tee_local $1 - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $0 - (get_local $3) - ) - ) ) - (loop $while-in58 - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) - ) - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 16) - ) + (block + (br_if $do-once55 + (i32.eqz + (tee_local $1 + (i32.load + (get_local $3) ) ) ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) - ) - ) - (if - (i32.lt_u - (get_local $0) - (get_local $4) ) - (call $_abort) - (block - (i32.store - (get_local $0) - (i32.const 0) - ) - (set_local $8 - (get_local $1) - ) + (set_local $0 + (get_local $3) ) ) ) - (block - (if - (i32.lt_u - (tee_local $2 - (i32.load offset=8 - (get_local $6) - ) - ) - (get_local $4) - ) - (call $_abort) - ) + (loop $while-in58 (if - (i32.ne - (get_local $6) + (tee_local $3 (i32.load - (tee_local $3 + (tee_local $2 (i32.add - (get_local $2) - (i32.const 12) + (get_local $1) + (i32.const 20) ) ) ) ) - (call $_abort) + (block + (set_local $1 + (get_local $3) + ) + (set_local $0 + (get_local $2) + ) + (br $while-in58) + ) ) (if - (i32.eq + (tee_local $3 (i32.load - (tee_local $1 + (tee_local $2 (i32.add - (get_local $0) - (i32.const 8) + (get_local $1) + (i32.const 16) ) ) ) - (get_local $6) ) (block - (i32.store + (set_local $1 (get_local $3) - (get_local $0) ) - (i32.store - (get_local $1) + (set_local $0 (get_local $2) ) - (set_local $8 - (get_local $0) - ) + (br $while-in58) ) - (call $_abort) ) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $5) + (if + (i32.lt_u + (get_local $0) + (get_local $4) + ) + (call $_abort) + (block + (i32.store + (get_local $0) + (i32.const 0) + ) + (set_local $8 + (get_local $1) + ) + ) ) ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (i32.shl - (tee_local $1 - (i32.load offset=28 - (get_local $6) - ) - ) - (i32.const 2) - ) - (i32.const 480) + (block + (if + (i32.lt_u + (tee_local $2 + (i32.load offset=8 + (get_local $6) ) ) + (get_local $4) ) - (get_local $6) + (call $_abort) ) - (block $do-once59 - (i32.store - (get_local $0) - (get_local $8) - ) - (br_if $do-once59 - (get_local $8) - ) - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) + (if + (i32.ne + (get_local $6) + (i32.load + (tee_local $3 + (i32.add + (get_local $2) + (i32.const 12) ) - (i32.const -1) ) ) ) - (br $label$break$L331) + (call $_abort) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $5) - (i32.const 16) - ) + (if + (i32.eq + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 8) ) ) - (get_local $6) ) + (get_local $6) + ) + (block (i32.store + (get_local $3) (get_local $0) - (get_local $8) ) - (i32.store offset=20 - (get_local $5) - (get_local $8) + (i32.store + (get_local $1) + (get_local $2) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $8) + (set_local $8 + (get_local $0) ) ) + (call $_abort) ) ) - (if - (i32.lt_u - (get_local $8) - (tee_local $1 - (i32.load - (i32.const 192) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $5) + ) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (i32.shl + (tee_local $1 + (i32.load offset=28 + (get_local $6) + ) + ) + (i32.const 2) + ) + (i32.const 480) ) ) ) - (call $_abort) - ) - (i32.store offset=24 - (get_local $8) - (get_local $5) + (get_local $6) ) - (if - (tee_local $3 - (i32.load - (tee_local $0 - (i32.add - (get_local $6) - (i32.const 16) + (block $do-once59 + (i32.store + (get_local $0) + (get_local $8) + ) + (br_if $do-once59 + (get_local $8) + ) + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) ) + (br $label$break$L331) + ) + (block (if (i32.lt_u - (get_local $3) - (get_local $1) + (get_local $5) + (i32.load + (i32.const 192) + ) ) (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $3) - ) - (i32.store offset=24 - (get_local $3) - (get_local $8) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $5) + (i32.const 16) + ) + ) ) + (get_local $6) + ) + (i32.store + (get_local $0) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) + ) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $8) ) ) ) - (br_if $label$break$L331 - (i32.eqz + ) + (if + (i32.lt_u + (get_local $8) + (tee_local $1 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $3 + (i32.load (tee_local $0 - (i32.load offset=4 - (get_local $0) + (i32.add + (get_local $6) + (i32.const 16) ) ) ) ) (if (i32.lt_u - (get_local $0) - (i32.load - (i32.const 192) - ) + (get_local $3) + (get_local $1) ) (call $_abort) (block - (i32.store offset=20 + (i32.store offset=16 (get_local $8) - (get_local $0) + (get_local $3) ) (i32.store offset=24 - (get_local $0) + (get_local $3) (get_local $8) ) ) ) ) + (br_if $label$break$L331 + (i32.eqz + (tee_local $0 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + (if + (i32.lt_u + (get_local $0) + (i32.load + (i32.const 192) + ) + ) + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) + (get_local $0) + ) + (i32.store offset=24 + (get_local $0) + (get_local $8) + ) + ) + ) ) ) - (set_local $7 - (i32.add - (get_local $7) - (get_local $10) - ) - ) + ) + (set_local $7 (i32.add - (get_local $6) + (get_local $7) (get_local $10) ) ) - (get_local $6) + (i32.add + (get_local $6) + (get_local $10) + ) ) + (get_local $6) ) (i32.const 4) ) diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise index ec57aa743..d8b8ea78b 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -169,22 +169,20 @@ (block $switch-default (if (tee_local $5 - (tee_local $3 + (tee_local $4 (i32.and - (tee_local $3 - (call $_bitshift64Lshr - (tee_local $2 - (i32.load - (get_global $tempDoublePtr) - ) + (call $_bitshift64Lshr + (tee_local $2 + (i32.load + (get_global $tempDoublePtr) ) - (tee_local $4 - (i32.load offset=4 - (get_global $tempDoublePtr) - ) + ) + (tee_local $3 + (i32.load offset=4 + (get_global $tempDoublePtr) ) - (i32.const 52) ) + (i32.const 52) ) (i32.const 2047) ) @@ -201,31 +199,29 @@ ) (i32.store (get_local $1) - (tee_local $2 - (if (result i32) - (f64.ne - (get_local $0) - (f64.const 0) - ) - (block (result i32) - (set_local $0 - (call $_frexp - (f64.mul - (get_local $0) - (f64.const 18446744073709551615) - ) - (get_local $1) + (if (result i32) + (f64.ne + (get_local $0) + (f64.const 0) + ) + (block (result i32) + (set_local $0 + (call $_frexp + (f64.mul + (get_local $0) + (f64.const 18446744073709551615) ) + (get_local $1) ) - (i32.add - (i32.load - (get_local $1) - ) - (i32.const -64) + ) + (i32.add + (i32.load + (get_local $1) ) + (i32.const -64) ) - (i32.const 0) ) + (i32.const 0) ) ) (br $switch) @@ -233,7 +229,7 @@ (i32.store (get_local $1) (i32.add - (get_local $3) + (get_local $4) (i32.const -1022) ) ) @@ -245,7 +241,7 @@ (get_global $tempDoublePtr) (i32.or (i32.and - (get_local $4) + (get_local $3) (i32.const -2146435073) ) (i32.const 1071644672) @@ -543,7 +539,6 @@ ) (func $_fflush (; 32 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) (if (get_local $0) (set_local $0 @@ -1489,58 +1484,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $1 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $1 + (i32.load (get_local $0) - (i32.or - (get_local $1) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $1) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (get_local $1) - (i32.load offset=48 - (get_local $0) - ) + (i32.load offset=48 + (get_local $0) ) ) - (i32.const 0) ) + (i32.const 0) ) ) ) @@ -1946,127 +1939,125 @@ (local $5 i32) (local $6 i32) (local $7 i32) - (tee_local $0 - (block $__rjto$0 (result i32) - (block $__rjti$0 - (br_if $__rjti$0 - (i32.le_u - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (block $__rjto$0 (result i32) + (block $__rjti$0 + (br_if $__rjti$0 + (i32.le_u + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) - (i32.load - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 28) - ) + ) + (i32.load + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 28) ) ) ) ) - (set_local $1 - (i32.load offset=36 - (get_local $0) - ) + ) + (set_local $1 + (i32.load offset=36 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (get_local $1) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (get_local $1) + (i32.const 7) ) + (i32.const 2) ) ) - (br_if $__rjti$0 - (i32.load - (get_local $2) - ) - ) - (br $__rjto$0 - (i32.const -1) + ) + (br_if $__rjti$0 + (i32.load + (get_local $2) ) ) - (if - (i32.lt_u - (tee_local $4 - (i32.load - (tee_local $1 - (i32.add - (get_local $0) - (i32.const 4) - ) + (br $__rjto$0 + (i32.const -1) + ) + ) + (if + (i32.lt_u + (tee_local $4 + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 4) ) ) ) - (tee_local $6 - (i32.load - (tee_local $5 - (i32.add - (get_local $0) - (i32.const 8) - ) + ) + (tee_local $6 + (i32.load + (tee_local $5 + (i32.add + (get_local $0) + (i32.const 8) ) ) ) ) - (block - (set_local $7 - (i32.load offset=40 - (get_local $0) - ) + ) + (block + (set_local $7 + (i32.load offset=40 + (get_local $0) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (get_local $0) - (i32.sub - (get_local $4) - (get_local $6) - ) - (i32.const 1) - (i32.add - (i32.and - (get_local $7) - (i32.const 7) - ) - (i32.const 2) + ) + (drop + (call_indirect (type $FUNCSIG$iiii) + (get_local $0) + (i32.sub + (get_local $4) + (get_local $6) + ) + (i32.const 1) + (i32.add + (i32.and + (get_local $7) + (i32.const 7) ) + (i32.const 2) ) ) ) ) - (i32.store offset=16 - (get_local $0) - (i32.const 0) - ) - (i32.store - (get_local $3) - (i32.const 0) - ) - (i32.store - (get_local $2) - (i32.const 0) - ) - (i32.store - (get_local $5) - (i32.const 0) - ) - (i32.store - (get_local $1) - (i32.const 0) - ) + ) + (i32.store offset=16 + (get_local $0) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (i32.store + (get_local $2) + (i32.const 0) + ) + (i32.store + (get_local $5) (i32.const 0) ) + (i32.store + (get_local $1) + (i32.const 0) + ) + (i32.const 0) ) ) (func $_cleanup (; 43 ;) (; has Stack IR ;) (param $0 i32) @@ -5850,13 +5841,13 @@ (call $_pad (get_local $0) (i32.const 48) - (block (result i32) - (if + (i32.add + (if (result i32) (i32.gt_s (get_local $5) (i32.const -1) ) - (block + (block (result i32) (set_local $18 (i32.eqz (get_local $21) @@ -6027,15 +6018,11 @@ ) ) ) - (set_local $5 - (get_local $7) - ) + (get_local $7) ) - ) - (i32.add (get_local $5) - (i32.const 18) ) + (i32.const 18) ) (i32.const 18) (i32.const 0) @@ -6127,9 +6114,9 @@ ) ) (if - (block (result i32) - (if - (i32.eqz + (i32.eqz + (i32.and + (if (result i32) (i32.and (tee_local $5 (i32.load @@ -6138,27 +6125,21 @@ ) (i32.const 32) ) - ) - (block - (drop - (call $___fwritex - (get_local $30) - (get_local $9) - (get_local $0) + (get_local $5) + (block (result i32) + (drop + (call $___fwritex + (get_local $30) + (get_local $9) + (get_local $0) + ) ) - ) - (set_local $5 (i32.load (get_local $0) ) ) ) - ) - (i32.eqz - (i32.and - (get_local $5) - (i32.const 32) - ) + (i32.const 32) ) ) (drop @@ -7261,12 +7242,10 @@ ) ) (i32.or - (tee_local $3 - (call $___uremdi3 - (get_local $0) - (get_local $1) - (i32.const 10) - ) + (call $___uremdi3 + (get_local $0) + (get_local $1) + (i32.const 10) ) (i32.const 48) ) @@ -11103,494 +11082,492 @@ (i32.store (tee_local $0 (i32.add - (tee_local $0 - (if (result i32) - (i32.eq - (i32.and - (tee_local $0 - (i32.load offset=4 - (get_local $6) - ) + (if (result i32) + (i32.eq + (i32.and + (tee_local $0 + (i32.load offset=4 + (get_local $6) ) - (i32.const 3) ) - (i32.const 1) + (i32.const 3) ) - (block (result i32) - (set_local $10 - (i32.and - (get_local $0) - (i32.const -8) - ) + (i32.const 1) + ) + (block (result i32) + (set_local $10 + (i32.and + (get_local $0) + (i32.const -8) ) - (set_local $1 - (i32.shr_u + ) + (set_local $1 + (i32.shr_u + (get_local $0) + (i32.const 3) + ) + ) + (block $label$break$L331 + (if + (i32.lt_u (get_local $0) - (i32.const 3) + (i32.const 256) ) - ) - (block $label$break$L331 - (if - (i32.lt_u - (get_local $0) - (i32.const 256) + (block + (set_local $2 + (i32.load offset=12 + (get_local $6) + ) ) - (block - (set_local $2 - (i32.load offset=12 - (get_local $6) + (if + (i32.ne + (tee_local $3 + (i32.load offset=8 + (get_local $6) + ) ) - ) - (if - (i32.ne - (tee_local $3 - (i32.load offset=8 - (get_local $6) + (tee_local $0 + (i32.add + (i32.shl + (get_local $1) + (i32.const 3) ) + (i32.const 216) ) - (tee_local $0 - (i32.add - (i32.shl - (get_local $1) - (i32.const 3) - ) - (i32.const 216) - ) + ) + ) + (block $do-once51 + (if + (i32.lt_u + (get_local $3) + (get_local $4) ) + (call $_abort) ) - (block $do-once51 - (if - (i32.lt_u + (br_if $do-once51 + (i32.eq + (i32.load offset=12 (get_local $3) - (get_local $4) - ) - (call $_abort) - ) - (br_if $do-once51 - (i32.eq - (i32.load offset=12 - (get_local $3) - ) - (get_local $6) ) + (get_local $6) ) - (call $_abort) ) + (call $_abort) ) - (if - (i32.eq - (get_local $2) - (get_local $3) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (i32.load - (i32.const 176) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) - ) - (i32.const -1) + ) + (if + (i32.eq + (get_local $2) + (get_local $3) + ) + (block + (i32.store + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) - (br $label$break$L331) ) + (br $label$break$L331) ) - (if - (i32.eq - (get_local $0) + ) + (if + (i32.eq + (get_local $0) + (get_local $2) + ) + (set_local $15 + (i32.add (get_local $2) + (i32.const 8) ) - (set_local $15 - (i32.add + ) + (block $do-once53 + (if + (i32.lt_u (get_local $2) - (i32.const 8) + (get_local $4) ) + (call $_abort) ) - (block $do-once53 - (if - (i32.lt_u - (get_local $2) - (get_local $4) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $2) - (i32.const 8) - ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $2) + (i32.const 8) ) ) - (get_local $6) ) - (block - (set_local $15 - (get_local $0) - ) - (br $do-once53) + (get_local $6) + ) + (block + (set_local $15 + (get_local $0) ) + (br $do-once53) ) - (call $_abort) ) - ) - (i32.store offset=12 - (get_local $3) - (get_local $2) - ) - (i32.store - (get_local $15) - (get_local $3) + (call $_abort) ) ) - (block - (set_local $5 - (i32.load offset=24 - (get_local $6) - ) + (i32.store offset=12 + (get_local $3) + (get_local $2) + ) + (i32.store + (get_local $15) + (get_local $3) + ) + ) + (block + (set_local $5 + (i32.load offset=24 + (get_local $6) ) - (if - (i32.eq - (tee_local $0 - (i32.load offset=12 - (get_local $6) - ) + ) + (if + (i32.eq + (tee_local $0 + (i32.load offset=12 + (get_local $6) ) - (get_local $6) ) - (block $do-once55 - (if - (i32.eqz - (tee_local $1 - (i32.load - (tee_local $0 - (i32.add - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) - ) + (get_local $6) + ) + (block $do-once55 + (if + (i32.eqz + (tee_local $1 + (i32.load + (tee_local $0 + (i32.add + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) ) - (i32.const 4) ) + (i32.const 4) ) ) ) ) - (block - (br_if $do-once55 - (i32.eqz - (tee_local $1 - (i32.load - (get_local $3) - ) - ) - ) - ) - (set_local $0 - (get_local $3) - ) - ) ) - (loop $while-in58 - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) - ) - (if - (tee_local $3 - (i32.load - (tee_local $2 - (i32.add - (get_local $1) - (i32.const 16) - ) + (block + (br_if $do-once55 + (i32.eqz + (tee_local $1 + (i32.load + (get_local $3) ) ) ) - (block - (set_local $1 - (get_local $3) - ) - (set_local $0 - (get_local $2) - ) - (br $while-in58) - ) ) - ) - (if - (i32.lt_u - (get_local $0) - (get_local $4) - ) - (call $_abort) - (block - (i32.store - (get_local $0) - (i32.const 0) - ) - (set_local $8 - (get_local $1) - ) + (set_local $0 + (get_local $3) ) ) ) - (block + (loop $while-in58 (if - (i32.lt_u - (tee_local $2 - (i32.load offset=8 - (get_local $6) - ) - ) - (get_local $4) - ) - (call $_abort) - ) - (if - (i32.ne - (get_local $6) + (tee_local $3 (i32.load - (tee_local $3 + (tee_local $2 (i32.add - (get_local $2) - (i32.const 12) + (get_local $1) + (i32.const 20) ) ) ) ) - (call $_abort) + (block + (set_local $1 + (get_local $3) + ) + (set_local $0 + (get_local $2) + ) + (br $while-in58) + ) ) (if - (i32.eq + (tee_local $3 (i32.load - (tee_local $1 + (tee_local $2 (i32.add - (get_local $0) - (i32.const 8) + (get_local $1) + (i32.const 16) ) ) ) - (get_local $6) ) (block - (i32.store + (set_local $1 (get_local $3) - (get_local $0) ) - (i32.store - (get_local $1) + (set_local $0 (get_local $2) ) - (set_local $8 - (get_local $0) - ) + (br $while-in58) ) - (call $_abort) ) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $5) + (if + (i32.lt_u + (get_local $0) + (get_local $4) + ) + (call $_abort) + (block + (i32.store + (get_local $0) + (i32.const 0) + ) + (set_local $8 + (get_local $1) + ) + ) ) ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (i32.shl - (tee_local $1 - (i32.load offset=28 - (get_local $6) - ) - ) - (i32.const 2) - ) - (i32.const 480) + (block + (if + (i32.lt_u + (tee_local $2 + (i32.load offset=8 + (get_local $6) ) ) + (get_local $4) ) - (get_local $6) + (call $_abort) ) - (block $do-once59 - (i32.store - (get_local $0) - (get_local $8) - ) - (br_if $do-once59 - (get_local $8) - ) - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $1) + (if + (i32.ne + (get_local $6) + (i32.load + (tee_local $3 + (i32.add + (get_local $2) + (i32.const 12) ) - (i32.const -1) ) ) ) - (br $label$break$L331) + (call $_abort) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (tee_local $0 - (i32.add - (get_local $5) - (i32.const 16) - ) + (if + (i32.eq + (i32.load + (tee_local $1 + (i32.add + (get_local $0) + (i32.const 8) ) ) - (get_local $6) ) + (get_local $6) + ) + (block (i32.store + (get_local $3) (get_local $0) - (get_local $8) ) - (i32.store offset=20 - (get_local $5) - (get_local $8) + (i32.store + (get_local $1) + (get_local $2) ) - ) - (br_if $label$break$L331 - (i32.eqz - (get_local $8) + (set_local $8 + (get_local $0) ) ) + (call $_abort) ) ) - (if - (i32.lt_u - (get_local $8) - (tee_local $1 - (i32.load - (i32.const 192) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $5) + ) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (i32.shl + (tee_local $1 + (i32.load offset=28 + (get_local $6) + ) + ) + (i32.const 2) + ) + (i32.const 480) ) ) ) - (call $_abort) - ) - (i32.store offset=24 - (get_local $8) - (get_local $5) + (get_local $6) ) - (if - (tee_local $3 - (i32.load - (tee_local $0 - (i32.add - (get_local $6) - (i32.const 16) + (block $do-once59 + (i32.store + (get_local $0) + (get_local $8) + ) + (br_if $do-once59 + (get_local $8) + ) + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $1) ) + (i32.const -1) ) ) ) + (br $label$break$L331) + ) + (block (if (i32.lt_u - (get_local $3) - (get_local $1) + (get_local $5) + (i32.load + (i32.const 192) + ) ) (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $3) - ) - (i32.store offset=24 - (get_local $3) - (get_local $8) + ) + (if + (i32.eq + (i32.load + (tee_local $0 + (i32.add + (get_local $5) + (i32.const 16) + ) + ) ) + (get_local $6) + ) + (i32.store + (get_local $0) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) + ) + ) + (br_if $label$break$L331 + (i32.eqz + (get_local $8) ) ) ) - (br_if $label$break$L331 - (i32.eqz + ) + (if + (i32.lt_u + (get_local $8) + (tee_local $1 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $3 + (i32.load (tee_local $0 - (i32.load offset=4 - (get_local $0) + (i32.add + (get_local $6) + (i32.const 16) ) ) ) ) (if (i32.lt_u - (get_local $0) - (i32.load - (i32.const 192) - ) + (get_local $3) + (get_local $1) ) (call $_abort) (block - (i32.store offset=20 + (i32.store offset=16 (get_local $8) - (get_local $0) + (get_local $3) ) (i32.store offset=24 - (get_local $0) + (get_local $3) (get_local $8) ) ) ) ) + (br_if $label$break$L331 + (i32.eqz + (tee_local $0 + (i32.load offset=4 + (get_local $0) + ) + ) + ) + ) + (if + (i32.lt_u + (get_local $0) + (i32.load + (i32.const 192) + ) + ) + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) + (get_local $0) + ) + (i32.store offset=24 + (get_local $0) + (get_local $8) + ) + ) + ) ) ) - (set_local $7 - (i32.add - (get_local $7) - (get_local $10) - ) - ) + ) + (set_local $7 (i32.add - (get_local $6) + (get_local $7) (get_local $10) ) ) - (get_local $6) + (i32.add + (get_local $6) + (get_local $10) + ) ) + (get_local $6) ) (i32.const 4) ) diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index 3dac1de09..3a4f72305 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -7699,7 +7699,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7708,13 +7708,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7727,7 +7727,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7737,7 +7737,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7755,7 +7755,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7770,7 +7770,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7789,51 +7789,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $Pa (call $ya (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $oa (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $Pa (call $ya (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7865,7 +7865,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7885,7 +7885,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7960,7 +7960,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7977,7 +7977,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7987,9 +7987,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8065,7 +8063,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8079,7 +8077,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8090,164 +8088,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$a (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$a - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + (get_local $1) + ) + (br $label$break$a + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$b + (set_local $3 + (get_local $1) ) - (block $label$break$b - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$b) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$b) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$a - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + ) + (drop + (br_if $label$break$a + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) - ) - ) - (set_local $0 - (i32.add - (get_local $0) (get_local $3) ) ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $jb - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $jb + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8392,102 +8388,97 @@ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - (tee_local $2 - (if (result i32) - (get_local $0) - (block $do-once (result i32) - (if - (i32.le_s - (i32.load offset=76 - (get_local $0) - ) - (i32.const -1) - ) - (br $do-once - (call $$a - (get_local $0) - ) + (if (result i32) + (get_local $0) + (block $do-once (result i32) + (if + (i32.le_s + (i32.load offset=76 + (get_local $0) ) + (i32.const -1) ) - (call $$a - (get_local $0) + (br $do-once + (call $$a + (get_local $0) + ) ) ) - (block (result i32) - (set_local $0 - (if (result i32) + (call $$a + (get_local $0) + ) + ) + (block (result i32) + (set_local $0 + (if (result i32) + (i32.load + (i32.const 1140) + ) + (call $_a (i32.load (i32.const 1140) ) - (call $_a - (i32.load - (i32.const 1140) - ) - ) - (i32.const 0) ) + (i32.const 0) ) - (call $pa - (i32.const 1188) + ) + (call $pa + (i32.const 1188) + ) + (if + (tee_local $1 + (i32.load + (i32.const 1184) + ) ) - (if - (tee_local $1 - (i32.load - (i32.const 1184) - ) + (block + (set_local $2 + (get_local $1) ) - (block - (set_local $2 - (get_local $1) - ) - (set_local $1 - (get_local $0) + (set_local $1 + (get_local $0) + ) + (loop $while-in + (drop + (i32.load offset=76 + (get_local $2) + ) ) - (loop $while-in - (drop - (i32.load offset=76 + (if + (i32.gt_u + (i32.load offset=20 + (get_local $2) + ) + (i32.load offset=28 (get_local $2) ) ) - (set_local $0 - (i32.const 0) - ) - (if - (i32.gt_u - (i32.load offset=20 - (get_local $2) - ) - (i32.load offset=28 + (set_local $1 + (i32.or + (call $$a (get_local $2) ) - ) - (set_local $1 - (i32.or - (call $$a - (get_local $2) - ) - (get_local $1) - ) + (get_local $1) ) ) - (br_if $while-in - (tee_local $2 - (i32.load offset=56 - (get_local $2) - ) + ) + (br_if $while-in + (tee_local $2 + (i32.load offset=56 + (get_local $2) ) ) ) ) - (set_local $1 - (get_local $0) - ) ) - (call $xa - (i32.const 1188) + (set_local $1 + (get_local $0) ) - (get_local $1) ) + (call $xa + (i32.const 1188) + ) + (get_local $1) ) ) ) @@ -8688,12 +8679,12 @@ (i32.const 3) ) ) - (if + (if (result i32) (i32.eq (get_local $1) (i32.const 3) ) - (block + (block (result i32) (if (i32.lt_u (tee_local $2 @@ -8757,12 +8748,10 @@ (get_local $1) (i32.const 0) ) - (set_local $2 - (i32.const 0) - ) + (i32.const 0) ) + (get_local $2) ) - (get_local $2) ) (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -9067,70 +9056,68 @@ ) (i32.shr_s (i32.shl - (tee_local $1 - (if (result i32) - (i32.lt_s - (i32.add - (call $bb + (if (result i32) + (i32.lt_s + (i32.add + (call $bb + (i32.const 1144) + (call $Za (i32.const 1144) - (call $Za - (i32.const 1144) - ) - (get_local $0) ) - (i32.const -1) + (get_local $0) ) - (i32.const 0) + (i32.const -1) ) - (i32.const 1) - (block $do-once (result i32) - (if - (i32.ne - (i32.load8_s offset=75 - (get_local $0) - ) - (i32.const 10) + (i32.const 0) + ) + (i32.const 1) + (block $do-once (result i32) + (if + (i32.ne + (i32.load8_s offset=75 + (get_local $0) ) - (if - (i32.lt_u - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.const 10) + ) + (if + (i32.lt_u + (tee_local $1 + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) ) - (i32.load offset=16 - (get_local $0) - ) ) - (block - (i32.store - (get_local $2) - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.store8 + (i32.load offset=16 + (get_local $0) + ) + ) + (block + (i32.store + (get_local $2) + (i32.add (get_local $1) - (i32.const 10) - ) - (br $do-once - (i32.const 0) + (i32.const 1) ) ) + (i32.store8 + (get_local $1) + (i32.const 10) + ) + (br $do-once + (i32.const 0) + ) ) ) - (i32.lt_s - (call $ab - (get_local $0) - ) - (i32.const 0) + ) + (i32.lt_s + (call $ab + (get_local $0) ) + (i32.const 0) ) ) ) @@ -9162,58 +9149,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/memorygrowth.fromasm.clamp b/test/memorygrowth.fromasm.clamp index 3dac1de09..3a4f72305 100644 --- a/test/memorygrowth.fromasm.clamp +++ b/test/memorygrowth.fromasm.clamp @@ -7699,7 +7699,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7708,13 +7708,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7727,7 +7727,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7737,7 +7737,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7755,7 +7755,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7770,7 +7770,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7789,51 +7789,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $Pa (call $ya (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $oa (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $Pa (call $ya (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7865,7 +7865,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7885,7 +7885,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7960,7 +7960,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7977,7 +7977,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7987,9 +7987,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8065,7 +8063,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8079,7 +8077,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8090,164 +8088,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$a (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$a - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + (get_local $1) + ) + (br $label$break$a + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$b + (set_local $3 + (get_local $1) ) - (block $label$break$b - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$b) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$b) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$a - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + ) + (drop + (br_if $label$break$a + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) - ) - ) - (set_local $0 - (i32.add - (get_local $0) (get_local $3) ) ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $jb - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $jb + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8392,102 +8388,97 @@ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - (tee_local $2 - (if (result i32) - (get_local $0) - (block $do-once (result i32) - (if - (i32.le_s - (i32.load offset=76 - (get_local $0) - ) - (i32.const -1) - ) - (br $do-once - (call $$a - (get_local $0) - ) + (if (result i32) + (get_local $0) + (block $do-once (result i32) + (if + (i32.le_s + (i32.load offset=76 + (get_local $0) ) + (i32.const -1) ) - (call $$a - (get_local $0) + (br $do-once + (call $$a + (get_local $0) + ) ) ) - (block (result i32) - (set_local $0 - (if (result i32) + (call $$a + (get_local $0) + ) + ) + (block (result i32) + (set_local $0 + (if (result i32) + (i32.load + (i32.const 1140) + ) + (call $_a (i32.load (i32.const 1140) ) - (call $_a - (i32.load - (i32.const 1140) - ) - ) - (i32.const 0) ) + (i32.const 0) ) - (call $pa - (i32.const 1188) + ) + (call $pa + (i32.const 1188) + ) + (if + (tee_local $1 + (i32.load + (i32.const 1184) + ) ) - (if - (tee_local $1 - (i32.load - (i32.const 1184) - ) + (block + (set_local $2 + (get_local $1) ) - (block - (set_local $2 - (get_local $1) - ) - (set_local $1 - (get_local $0) + (set_local $1 + (get_local $0) + ) + (loop $while-in + (drop + (i32.load offset=76 + (get_local $2) + ) ) - (loop $while-in - (drop - (i32.load offset=76 + (if + (i32.gt_u + (i32.load offset=20 + (get_local $2) + ) + (i32.load offset=28 (get_local $2) ) ) - (set_local $0 - (i32.const 0) - ) - (if - (i32.gt_u - (i32.load offset=20 - (get_local $2) - ) - (i32.load offset=28 + (set_local $1 + (i32.or + (call $$a (get_local $2) ) - ) - (set_local $1 - (i32.or - (call $$a - (get_local $2) - ) - (get_local $1) - ) + (get_local $1) ) ) - (br_if $while-in - (tee_local $2 - (i32.load offset=56 - (get_local $2) - ) + ) + (br_if $while-in + (tee_local $2 + (i32.load offset=56 + (get_local $2) ) ) ) ) - (set_local $1 - (get_local $0) - ) ) - (call $xa - (i32.const 1188) + (set_local $1 + (get_local $0) ) - (get_local $1) ) + (call $xa + (i32.const 1188) + ) + (get_local $1) ) ) ) @@ -8688,12 +8679,12 @@ (i32.const 3) ) ) - (if + (if (result i32) (i32.eq (get_local $1) (i32.const 3) ) - (block + (block (result i32) (if (i32.lt_u (tee_local $2 @@ -8757,12 +8748,10 @@ (get_local $1) (i32.const 0) ) - (set_local $2 - (i32.const 0) - ) + (i32.const 0) ) + (get_local $2) ) - (get_local $2) ) (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -9067,70 +9056,68 @@ ) (i32.shr_s (i32.shl - (tee_local $1 - (if (result i32) - (i32.lt_s - (i32.add - (call $bb + (if (result i32) + (i32.lt_s + (i32.add + (call $bb + (i32.const 1144) + (call $Za (i32.const 1144) - (call $Za - (i32.const 1144) - ) - (get_local $0) ) - (i32.const -1) + (get_local $0) ) - (i32.const 0) + (i32.const -1) ) - (i32.const 1) - (block $do-once (result i32) - (if - (i32.ne - (i32.load8_s offset=75 - (get_local $0) - ) - (i32.const 10) + (i32.const 0) + ) + (i32.const 1) + (block $do-once (result i32) + (if + (i32.ne + (i32.load8_s offset=75 + (get_local $0) ) - (if - (i32.lt_u - (tee_local $1 - (i32.load - (tee_local $2 - (i32.add - (get_local $0) - (i32.const 20) - ) + (i32.const 10) + ) + (if + (i32.lt_u + (tee_local $1 + (i32.load + (tee_local $2 + (i32.add + (get_local $0) + (i32.const 20) ) ) ) - (i32.load offset=16 - (get_local $0) - ) ) - (block - (i32.store - (get_local $2) - (i32.add - (get_local $1) - (i32.const 1) - ) - ) - (i32.store8 + (i32.load offset=16 + (get_local $0) + ) + ) + (block + (i32.store + (get_local $2) + (i32.add (get_local $1) - (i32.const 10) - ) - (br $do-once - (i32.const 0) + (i32.const 1) ) ) + (i32.store8 + (get_local $1) + (i32.const 10) + ) + (br $do-once + (i32.const 0) + ) ) ) - (i32.lt_s - (call $ab - (get_local $0) - ) - (i32.const 0) + ) + (i32.lt_s + (call $ab + (get_local $0) ) + (i32.const 0) ) ) ) @@ -9162,58 +9149,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise index 0044bab54..de91f08d8 100644 --- a/test/memorygrowth.fromasm.imprecise +++ b/test/memorygrowth.fromasm.imprecise @@ -7697,7 +7697,7 @@ (i32.const 48) ) ) - (set_local $10 + (set_local $9 (i32.add (get_local $12) (i32.const 16) @@ -7706,13 +7706,13 @@ (i32.store (tee_local $3 (i32.add - (tee_local $11 + (tee_local $10 (get_local $12) ) (i32.const 32) ) ) - (tee_local $8 + (tee_local $11 (i32.load (tee_local $7 (i32.add @@ -7725,7 +7725,7 @@ ) (i32.store offset=4 (get_local $3) - (tee_local $9 + (tee_local $8 (i32.sub (i32.load (tee_local $13 @@ -7735,7 +7735,7 @@ ) ) ) - (get_local $8) + (get_local $11) ) ) ) @@ -7753,7 +7753,7 @@ (i32.const 60) ) ) - (set_local $8 + (set_local $11 (i32.add (get_local $0) (i32.const 44) @@ -7768,7 +7768,7 @@ (set_local $4 (i32.add (get_local $2) - (get_local $9) + (get_local $8) ) ) (loop $while-in @@ -7787,51 +7787,51 @@ (get_local $0) ) (i32.store - (get_local $11) + (get_local $10) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $11) + (get_local $10) (get_local $5) ) (i32.store offset=8 - (get_local $11) + (get_local $10) (get_local $3) ) - (set_local $9 + (set_local $8 (call $Pa (call $ya (i32.const 146) - (get_local $11) + (get_local $10) ) ) ) (call $oa (i32.const 0) ) - (get_local $9) + (get_local $8) ) (block (result i32) (i32.store - (get_local $10) + (get_local $9) (i32.load (get_local $1) ) ) (i32.store offset=4 - (get_local $10) + (get_local $9) (get_local $5) ) (i32.store offset=8 - (get_local $10) + (get_local $9) (get_local $3) ) (call $Pa (call $ya (i32.const 146) - (get_local $10) + (get_local $9) ) ) ) @@ -7863,7 +7863,7 @@ (br $while-out) ) ) - (set_local $9 + (set_local $8 (i32.sub (get_local $4) (get_local $6) @@ -7883,7 +7883,7 @@ (get_local $7) (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) ) @@ -7958,7 +7958,7 @@ ) ) (set_local $4 - (get_local $9) + (get_local $8) ) (br $while-in) ) @@ -7977,7 +7977,7 @@ (i32.add (tee_local $4 (i32.load - (get_local $8) + (get_local $11) ) ) (i32.load offset=48 @@ -7987,9 +7987,7 @@ ) (i32.store (get_local $7) - (tee_local $8 - (get_local $4) - ) + (get_local $4) ) (i32.store (get_local $13) @@ -8060,7 +8058,7 @@ ) ) (block - (set_local $6 + (set_local $5 (get_local $4) ) (set_local $7 @@ -8074,7 +8072,7 @@ ) ) (block - (set_local $6 + (set_local $5 (i32.load (get_local $3) ) @@ -8085,164 +8083,162 @@ ) ) ) - (if + (if (result i32) (i32.eq (get_local $7) (i32.const 5) ) - (set_local $5 - (block $label$break$a (result i32) - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $4 - (i32.add - (get_local $2) - (i32.const 20) - ) + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $5) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) ) ) ) ) - (get_local $1) ) - (br $label$break$a - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $1) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + (get_local $1) + ) + (br $label$break$a + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $1) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) ) ) - (set_local $5 - (get_local $3) + ) + (set_local $6 + (get_local $3) + ) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (block $label$break$b + (set_local $3 + (get_local $1) ) - (block $label$break$b - (set_local $3 - (get_local $1) - ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) - ) - (br $label$break$b) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) ) + (br $label$break$b) ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) - ) + ) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $5 + (i32.add + (get_local $3) + (i32.const -1) ) ) ) - (i32.const 10) ) - (block - (set_local $3 - (get_local $6) - ) - (br $while-in) + (i32.const 10) + ) + (block + (set_local $3 + (get_local $5) ) + (br $while-in) ) ) - (drop - (br_if $label$break$a - (get_local $3) - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) - (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) - ) - (i32.const 3) + ) + (drop + (br_if $label$break$a + (get_local $3) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) ) - (i32.const 2) + (i32.const 3) ) + (i32.const 2) ) - (get_local $3) ) - ) - ) - (set_local $1 - (i32.sub - (get_local $1) (get_local $3) ) ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) - ) - ) - (set_local $5 - (i32.load - (get_local $4) - ) - ) ) - (set_local $3 - (i32.const 0) + (set_local $1 + (i32.sub + (get_local $1) + (get_local $3) + ) ) - ) - (drop - (call $jb - (get_local $5) - (get_local $0) - (get_local $1) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (i32.store - (get_local $4) - (i32.add - (get_local $1) + (set_local $6 (i32.load (get_local $4) ) ) ) + (set_local $3 + (i32.const 0) + ) + ) + (drop + (call $jb + (get_local $6) + (get_local $0) + (get_local $1) + ) + ) + (i32.store + (get_local $4) (i32.add (get_local $1) - (get_local $3) + (i32.load + (get_local $4) + ) ) ) + (i32.add + (get_local $1) + (get_local $3) + ) ) + (get_local $6) ) - (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) @@ -8387,97 +8383,92 @@ (func $_a (; 18 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) (local $2 i32) - (tee_local $2 - (if (result i32) - (get_local $0) - (block $do-once (result i32) - (if - (i32.le_s - (i32.load offset=76 - (get_local $0) - ) - (i32.const -1) - ) - (br $do-once - (call $$a - (get_local $0) - ) + (if (result i32) + (get_local $0) + (block $do-once (result i32) + (if + (i32.le_s + (i32.load offset=76 + (get_local $0) ) + (i32.const -1) ) - (call $$a - (get_local $0) + (br $do-once + (call $$a + (get_local $0) + ) ) ) - (block (result i32) - (set_local $0 - (if (result i32) + (call $$a + (get_local $0) + ) + ) + (block (result i32) + (set_local $0 + (if (result i32) + (i32.load + (i32.const 1140) + ) + (call $_a (i32.load (i32.const 1140) ) - (call $_a - (i32.load - (i32.const 1140) - ) - ) - (i32.const 0) ) + (i32.const 0) ) - (call $pa - (i32.const 1188) + ) + (call $pa + (i32.const 1188) + ) + (if + (tee_local $1 + (i32.load + (i32.const 1184) + ) ) - (if - (tee_local $1 - (i32.load - (i32.const 1184) - ) + (block + (set_local $2 + (get_local $1) ) - (block - (set_local $2 - (get_local $1) - ) - (set_local $1 - (get_local $0) - ) - (loop $while-in - (set_local $0 - (i32.const 0) - ) - (if - (i32.gt_u - (i32.load offset=20 - (get_local $2) - ) - (i32.load offset=28 - (get_local $2) - ) + (set_local $1 + (get_local $0) + ) + (loop $while-in + (if + (i32.gt_u + (i32.load offset=20 + (get_local $2) ) - (set_local $1 - (i32.or - (call $$a - (get_local $2) - ) - (get_local $1) - ) + (i32.load offset=28 + (get_local $2) ) ) - (br_if $while-in - (tee_local $2 - (i32.load offset=56 + (set_local $1 + (i32.or + (call $$a (get_local $2) ) + (get_local $1) + ) + ) + ) + (br_if $while-in + (tee_local $2 + (i32.load offset=56 + (get_local $2) ) ) ) - ) - (set_local $1 - (get_local $0) ) ) - (call $xa - (i32.const 1188) + (set_local $1 + (get_local $0) ) - (get_local $1) ) + (call $xa + (i32.const 1188) + ) + (get_local $1) ) ) ) @@ -8678,12 +8669,12 @@ (i32.const 3) ) ) - (if + (if (result i32) (i32.eq (get_local $1) (i32.const 3) ) - (block + (block (result i32) (if (i32.lt_u (tee_local $2 @@ -8747,12 +8738,10 @@ (get_local $1) (i32.const 0) ) - (set_local $2 - (i32.const 0) - ) + (i32.const 0) ) + (get_local $2) ) - (get_local $2) ) (func $jb (; 21 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -9167,58 +9156,56 @@ ) ) ) - (tee_local $0 - (if (result i32) - (i32.and - (tee_local $2 - (i32.load - (get_local $0) - ) - ) - (i32.const 8) - ) - (block (result i32) - (i32.store + (if (result i32) + (i32.and + (tee_local $2 + (i32.load (get_local $0) - (i32.or - (get_local $2) - (i32.const 32) - ) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (get_local $0) - (i32.const 0) - ) - (i32.store offset=4 - (get_local $0) - (i32.const 0) + (i32.const 8) + ) + (block (result i32) + (i32.store + (get_local $0) + (i32.or + (get_local $2) + (i32.const 32) ) - (i32.store offset=28 - (get_local $0) - (tee_local $1 - (i32.load offset=44 - (get_local $0) - ) + ) + (i32.const -1) + ) + (block (result i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=4 + (get_local $0) + (i32.const 0) + ) + (i32.store offset=28 + (get_local $0) + (tee_local $1 + (i32.load offset=44 + (get_local $0) ) ) - (i32.store offset=20 - (get_local $0) - (get_local $1) - ) - (i32.store offset=16 - (get_local $0) - (i32.add - (i32.load offset=48 - (get_local $0) - ) - (get_local $1) + ) + (i32.store offset=20 + (get_local $0) + (get_local $1) + ) + (i32.store offset=16 + (get_local $0) + (i32.add + (i32.load offset=48 + (get_local $0) ) + (get_local $1) ) - (i32.const 0) ) + (i32.const 0) ) ) ) diff --git a/test/passes/O.txt b/test/passes/O.txt index ca6a7f81f..3e557919f 100644 --- a/test/passes/O.txt +++ b/test/passes/O.txt @@ -5,6 +5,8 @@ (export "ret" (func $ret)) (export "waka" (func $if-0-unreachable-to-none)) (export "many-selects" (func $many-selects)) + (export "end-if-else" (func $end-if-else)) + (export "end-if-else-call" (func $end-if-else-call)) (func $ret (; 0 ;) (; has Stack IR ;) (type $0) (result i32) (drop (call $ret) @@ -21,22 +23,34 @@ (unreachable) ) (func $many-selects (; 2 ;) (; has Stack IR ;) (type $2) (param $0 i32) (result i32) - (tee_local $0 + (select + (i32.const -1073741824) (select - (i32.const -1073741824) - (select - (i32.const 1073741823) - (get_local $0) - (i32.gt_s - (get_local $0) - (i32.const 1073741823) - ) - ) - (i32.lt_s + (i32.const 1073741823) + (get_local $0) + (i32.gt_s (get_local $0) - (i32.const -1073741824) + (i32.const 1073741823) ) ) + (i32.lt_s + (get_local $0) + (i32.const -1073741824) + ) + ) + ) + (func $end-if-else (; 3 ;) (; has Stack IR ;) (type $2) (param $0 i32) (result i32) + (select + (i32.const 1) + (get_local $0) + (get_local $0) + ) + ) + (func $end-if-else-call (; 4 ;) (; has Stack IR ;) (type $2) (param $0 i32) (result i32) + (if (result i32) + (get_local $0) + (call $ret) + (get_local $0) ) ) ) diff --git a/test/passes/O.wast b/test/passes/O.wast index e183e02c1..ec8b78a3f 100644 --- a/test/passes/O.wast +++ b/test/passes/O.wast @@ -45,5 +45,23 @@ ) (get_local $0) ) + (func $end-if-else (export "end-if-else") (param $x i32) (result i32) + (if + (get_local $x) + (set_local $x + (i32.const 1) + ) + ) + (get_local $x) + ) + (func $end-if-else-call (export "end-if-else-call") (param $x i32) (result i32) + (if + (get_local $x) + (set_local $x + (call $ret) + ) + ) + (get_local $x) + ) ) diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt index 35d1219fe..1e3c20a57 100644 --- a/test/passes/inlining-optimizing_optimize-level=3.txt +++ b/test/passes/inlining-optimizing_optimize-level=3.txt @@ -553,7 +553,6 @@ ) (func $_fflush (; 32 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) (local $1 i32) - (local $2 i32) (if (get_local $0) (set_local $0 @@ -1038,7 +1037,6 @@ (local $10 i32) (local $11 i32) (local $12 i32) - (local $13 i32) (set_local $3 (get_global $STACKTOP) ) @@ -4662,11 +4660,9 @@ (set_local $20 (i32.add (i32.div_s - (tee_local $6 - (i32.add - (get_local $18) - (i32.const 25) - ) + (i32.add + (get_local $18) + (i32.const 25) ) (i32.const 9) ) @@ -4986,12 +4982,10 @@ (block (result i32) (set_local $13 (i32.div_s - (tee_local $11 - (tee_local $6 - (i32.add - (get_local $6) - (i32.const 9216) - ) + (tee_local $6 + (i32.add + (get_local $6) + (i32.const 9216) ) ) (i32.const 9) @@ -6287,9 +6281,9 @@ ) ) (if - (block (result i32) - (if - (i32.eqz + (i32.eqz + (i32.and + (if (result i32) (i32.and (tee_local $5 (i32.load @@ -6298,27 +6292,21 @@ ) (i32.const 32) ) - ) - (block - (drop - (call $___fwritex - (get_local $30) - (get_local $9) - (get_local $0) + (get_local $5) + (block (result i32) + (drop + (call $___fwritex + (get_local $30) + (get_local $9) + (get_local $0) + ) ) - ) - (set_local $5 (i32.load (get_local $0) ) ) ) - ) - (i32.eqz - (i32.and - (get_local $5) - (i32.const 32) - ) + (i32.const 32) ) ) (drop diff --git a/test/unit.fromasm b/test/unit.fromasm index 57277cdd3..f1296864c 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -233,7 +233,7 @@ ) ) (func $smallCompare (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) - (if + (if (result i32) (i32.lt_u (tee_local $0 (select @@ -250,14 +250,12 @@ ) (get_local $1) ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) + (i32.add + (get_local $0) + (i32.const 1) ) + (get_local $0) ) - (get_local $0) ) (func $cneg_nosemicolon (; 20 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp index 9947d9315..bfbcbd194 100644 --- a/test/unit.fromasm.clamp +++ b/test/unit.fromasm.clamp @@ -283,7 +283,7 @@ ) ) (func $smallCompare (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) - (if + (if (result i32) (i32.lt_u (tee_local $0 (select @@ -300,14 +300,12 @@ ) (get_local $1) ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) + (i32.add + (get_local $0) + (i32.const 1) ) + (get_local $0) ) - (get_local $0) ) (func $cneg_nosemicolon (; 21 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index a56482591..e1e379885 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -232,7 +232,7 @@ ) ) (func $smallCompare (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) - (if + (if (result i32) (i32.lt_u (tee_local $0 (select @@ -249,14 +249,12 @@ ) (get_local $1) ) - (set_local $0 - (i32.add - (get_local $0) - (i32.const 1) - ) + (i32.add + (get_local $0) + (i32.const 1) ) + (get_local $0) ) - (get_local $0) ) (func $cneg_nosemicolon (; 19 ;) (; has Stack IR ;) (call_indirect (type $FUNCSIG$vi) diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index 75c264e83..55a254c88 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -224,16 +224,7 @@ (get_local $1) ) ) - (func $test (; 8 ;) (; has Stack IR ;) - (local $0 f32) - (local $1 i32) - (set_local $1 - (i32.reinterpret/f32 - (get_local $0) - ) - ) - ) - (func $i64s-div (; 9 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) + (func $i64s-div (; 8 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) (if (result i64) (i64.eqz (get_local $1) @@ -258,7 +249,7 @@ ) ) ) - (func $f32-to-int64 (; 10 ;) (; has Stack IR ;) (param $0 f32) (result i64) + (func $f32-to-int64 (; 9 ;) (; has Stack IR ;) (param $0 f32) (result i64) (if (result i64) (f32.ne (get_local $0) @@ -284,7 +275,7 @@ ) ) ) - (func $f64-to-int64 (; 11 ;) (; has Stack IR ;) (param $0 f64) (result i64) + (func $f64-to-int64 (; 10 ;) (; has Stack IR ;) (param $0 f64) (result i64) (if (result i64) (f64.ne (get_local $0) @@ -310,7 +301,7 @@ ) ) ) - (func $f32-to-uint64 (; 12 ;) (; has Stack IR ;) (param $0 f32) (result i64) + (func $f32-to-uint64 (; 11 ;) (; has Stack IR ;) (param $0 f32) (result i64) (if (result i64) (f32.ne (get_local $0) @@ -336,7 +327,7 @@ ) ) ) - (func $f64-to-uint64 (; 13 ;) (; has Stack IR ;) (param $0 f64) (result i64) + (func $f64-to-uint64 (; 12 ;) (; has Stack IR ;) (param $0 f64) (result i64) (if (result i64) (f64.ne (get_local $0) @@ -362,22 +353,18 @@ ) ) ) - (func $test64 (; 14 ;) (; has Stack IR ;) + (func $test64 (; 13 ;) (; has Stack IR ;) (local $0 i64) (local $1 f32) (local $2 f64) (drop (i64.rem_s - (tee_local $0 - (i64.rem_u - (tee_local $0 - (call $i64s-div - (i64.const 100) - (i64.const 128849018897) - ) - ) + (i64.rem_u + (call $i64s-div + (i64.const 100) (i64.const 128849018897) ) + (i64.const 128849018897) ) (i64.const 128849018897) ) @@ -461,7 +448,7 @@ ) ) ) - (func $imports (; 15 ;) (; has Stack IR ;) (result i64) + (func $imports (; 14 ;) (; has Stack IR ;) (result i64) (call $legalfunc$illegalImport (f64.const -3.13159) (i64.const 94489280523) @@ -479,7 +466,7 @@ ) ) ) - (func $arg (; 16 ;) (; has Stack IR ;) (param $0 i64) + (func $arg (; 15 ;) (; has Stack IR ;) (param $0 i64) (i64.store (i32.const 100) (get_local $0) @@ -488,7 +475,7 @@ (get_local $0) ) ) - (func $illegalParam (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) + (func $illegalParam (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) (i32.store (i32.const 50) (get_local $0) @@ -507,12 +494,12 @@ (f64.const 12.34) ) ) - (func $call1 (; 18 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call1 (; 17 ;) (; has Stack IR ;) (param $0 i64) (result i64) (call $call1 (get_local $0) ) ) - (func $call2 (; 19 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call2 (; 18 ;) (; has Stack IR ;) (param $0 i64) (result i64) (drop (call $call2 (call $call2 @@ -522,19 +509,19 @@ ) (i64.const 245127260211081) ) - (func $ifValue32 (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $ifValue32 (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (call $ifValue32 (get_local $0) (get_local $1) ) ) - (func $unreachable_leftovers (; 21 ;) (; has Stack IR ;) + (func $unreachable_leftovers (; 20 ;) (; has Stack IR ;) (i32.store (i32.const 0) (i32.const -2) ) ) - (func $_memchr (; 22 ;) (; has Stack IR ;) (result i32) + (func $_memchr (; 21 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -656,13 +643,11 @@ (get_local $0) ) ) - (func $keepAlive (; 23 ;) (; has Stack IR ;) + (func $keepAlive (; 22 ;) (; has Stack IR ;) (call $loads) (call $loads) (call $stores) (call $stores) - (call $test) - (call $test) (drop (call $imports) ) @@ -723,7 +708,7 @@ (call $_memchr) ) ) - (func $legalstub$illegalParam (; 24 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) + (func $legalstub$illegalParam (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) (i64.or @@ -740,13 +725,13 @@ (get_local $3) ) ) - (func $legalstub$illegalResult (; 25 ;) (; has Stack IR ;) (result i32) + (func $legalstub$illegalResult (; 24 ;) (; has Stack IR ;) (result i32) (call $setTempRet0 (i32.const 2) ) (i32.const 1) ) - (func $legalfunc$illegalImport (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) + (func $legalfunc$illegalImport (; 25 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) (call $legalimport$illegalImport (get_local $0) (i32.wrap/i64 @@ -761,7 +746,7 @@ (get_local $2) ) ) - (func $legalfunc$_fabsf (; 27 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (func $legalfunc$_fabsf (; 26 ;) (; has Stack IR ;) (param $0 f32) (result f32) (f32.demote/f64 (call $legalimport$_fabsf (f64.promote/f32 @@ -770,7 +755,7 @@ ) ) ) - (func $legalfunc$do_i64 (; 28 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 27 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_u/i32 (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.clamp b/test/wasm-only.fromasm.clamp index 75c264e83..55a254c88 100644 --- a/test/wasm-only.fromasm.clamp +++ b/test/wasm-only.fromasm.clamp @@ -224,16 +224,7 @@ (get_local $1) ) ) - (func $test (; 8 ;) (; has Stack IR ;) - (local $0 f32) - (local $1 i32) - (set_local $1 - (i32.reinterpret/f32 - (get_local $0) - ) - ) - ) - (func $i64s-div (; 9 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) + (func $i64s-div (; 8 ;) (; has Stack IR ;) (param $0 i64) (param $1 i64) (result i64) (if (result i64) (i64.eqz (get_local $1) @@ -258,7 +249,7 @@ ) ) ) - (func $f32-to-int64 (; 10 ;) (; has Stack IR ;) (param $0 f32) (result i64) + (func $f32-to-int64 (; 9 ;) (; has Stack IR ;) (param $0 f32) (result i64) (if (result i64) (f32.ne (get_local $0) @@ -284,7 +275,7 @@ ) ) ) - (func $f64-to-int64 (; 11 ;) (; has Stack IR ;) (param $0 f64) (result i64) + (func $f64-to-int64 (; 10 ;) (; has Stack IR ;) (param $0 f64) (result i64) (if (result i64) (f64.ne (get_local $0) @@ -310,7 +301,7 @@ ) ) ) - (func $f32-to-uint64 (; 12 ;) (; has Stack IR ;) (param $0 f32) (result i64) + (func $f32-to-uint64 (; 11 ;) (; has Stack IR ;) (param $0 f32) (result i64) (if (result i64) (f32.ne (get_local $0) @@ -336,7 +327,7 @@ ) ) ) - (func $f64-to-uint64 (; 13 ;) (; has Stack IR ;) (param $0 f64) (result i64) + (func $f64-to-uint64 (; 12 ;) (; has Stack IR ;) (param $0 f64) (result i64) (if (result i64) (f64.ne (get_local $0) @@ -362,22 +353,18 @@ ) ) ) - (func $test64 (; 14 ;) (; has Stack IR ;) + (func $test64 (; 13 ;) (; has Stack IR ;) (local $0 i64) (local $1 f32) (local $2 f64) (drop (i64.rem_s - (tee_local $0 - (i64.rem_u - (tee_local $0 - (call $i64s-div - (i64.const 100) - (i64.const 128849018897) - ) - ) + (i64.rem_u + (call $i64s-div + (i64.const 100) (i64.const 128849018897) ) + (i64.const 128849018897) ) (i64.const 128849018897) ) @@ -461,7 +448,7 @@ ) ) ) - (func $imports (; 15 ;) (; has Stack IR ;) (result i64) + (func $imports (; 14 ;) (; has Stack IR ;) (result i64) (call $legalfunc$illegalImport (f64.const -3.13159) (i64.const 94489280523) @@ -479,7 +466,7 @@ ) ) ) - (func $arg (; 16 ;) (; has Stack IR ;) (param $0 i64) + (func $arg (; 15 ;) (; has Stack IR ;) (param $0 i64) (i64.store (i32.const 100) (get_local $0) @@ -488,7 +475,7 @@ (get_local $0) ) ) - (func $illegalParam (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) + (func $illegalParam (; 16 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) (i32.store (i32.const 50) (get_local $0) @@ -507,12 +494,12 @@ (f64.const 12.34) ) ) - (func $call1 (; 18 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call1 (; 17 ;) (; has Stack IR ;) (param $0 i64) (result i64) (call $call1 (get_local $0) ) ) - (func $call2 (; 19 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call2 (; 18 ;) (; has Stack IR ;) (param $0 i64) (result i64) (drop (call $call2 (call $call2 @@ -522,19 +509,19 @@ ) (i64.const 245127260211081) ) - (func $ifValue32 (; 20 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $ifValue32 (; 19 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (call $ifValue32 (get_local $0) (get_local $1) ) ) - (func $unreachable_leftovers (; 21 ;) (; has Stack IR ;) + (func $unreachable_leftovers (; 20 ;) (; has Stack IR ;) (i32.store (i32.const 0) (i32.const -2) ) ) - (func $_memchr (; 22 ;) (; has Stack IR ;) (result i32) + (func $_memchr (; 21 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -656,13 +643,11 @@ (get_local $0) ) ) - (func $keepAlive (; 23 ;) (; has Stack IR ;) + (func $keepAlive (; 22 ;) (; has Stack IR ;) (call $loads) (call $loads) (call $stores) (call $stores) - (call $test) - (call $test) (drop (call $imports) ) @@ -723,7 +708,7 @@ (call $_memchr) ) ) - (func $legalstub$illegalParam (; 24 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) + (func $legalstub$illegalParam (; 23 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) (i64.or @@ -740,13 +725,13 @@ (get_local $3) ) ) - (func $legalstub$illegalResult (; 25 ;) (; has Stack IR ;) (result i32) + (func $legalstub$illegalResult (; 24 ;) (; has Stack IR ;) (result i32) (call $setTempRet0 (i32.const 2) ) (i32.const 1) ) - (func $legalfunc$illegalImport (; 26 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) + (func $legalfunc$illegalImport (; 25 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) (call $legalimport$illegalImport (get_local $0) (i32.wrap/i64 @@ -761,7 +746,7 @@ (get_local $2) ) ) - (func $legalfunc$_fabsf (; 27 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (func $legalfunc$_fabsf (; 26 ;) (; has Stack IR ;) (param $0 f32) (result f32) (f32.demote/f64 (call $legalimport$_fabsf (f64.promote/f32 @@ -770,7 +755,7 @@ ) ) ) - (func $legalfunc$do_i64 (; 28 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 27 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_u/i32 (call $legalimport$do_i64) diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise index f7626db75..3f9053fab 100644 --- a/test/wasm-only.fromasm.imprecise +++ b/test/wasm-only.fromasm.imprecise @@ -110,22 +110,9 @@ (get_local $1) ) ) - (func $test (; 7 ;) (; has Stack IR ;) - (local $0 f32) - (local $1 i32) - (set_local $1 - (i32.reinterpret/f32 - (get_local $0) - ) - ) - ) - (func $test64 (; 8 ;) (; has Stack IR ;) + (func $test64 (; 7 ;) (; has Stack IR ;) (local $0 i64) (local $1 i32) - (local $2 i64) - (set_local $2 - (i64.const 128849018897) - ) (i64.store (i32.const 120) (tee_local $0 @@ -155,13 +142,8 @@ (get_local $0) ) ) - (set_local $0 - (i64.extend_u/i32 - (get_local $1) - ) - ) ) - (func $imports (; 9 ;) (; has Stack IR ;) (result i64) + (func $imports (; 8 ;) (; has Stack IR ;) (result i64) (call $legalfunc$illegalImport (f64.const -3.13159) (i64.const 94489280523) @@ -179,7 +161,7 @@ ) ) ) - (func $arg (; 10 ;) (; has Stack IR ;) (param $0 i64) + (func $arg (; 9 ;) (; has Stack IR ;) (param $0 i64) (i64.store (i32.const 100) (get_local $0) @@ -188,7 +170,7 @@ (get_local $0) ) ) - (func $illegalParam (; 11 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) + (func $illegalParam (; 10 ;) (; has Stack IR ;) (param $0 i32) (param $1 i64) (param $2 f64) (i32.store (i32.const 50) (get_local $0) @@ -207,12 +189,12 @@ (f64.const 12.34) ) ) - (func $call1 (; 12 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call1 (; 11 ;) (; has Stack IR ;) (param $0 i64) (result i64) (call $call1 (get_local $0) ) ) - (func $call2 (; 13 ;) (; has Stack IR ;) (param $0 i64) (result i64) + (func $call2 (; 12 ;) (; has Stack IR ;) (param $0 i64) (result i64) (drop (call $call2 (call $call2 @@ -222,19 +204,19 @@ ) (i64.const 245127260211081) ) - (func $ifValue32 (; 14 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) + (func $ifValue32 (; 13 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) (call $ifValue32 (get_local $0) (get_local $1) ) ) - (func $unreachable_leftovers (; 15 ;) (; has Stack IR ;) + (func $unreachable_leftovers (; 14 ;) (; has Stack IR ;) (i32.store (i32.const 0) (i32.const -2) ) ) - (func $_memchr (; 16 ;) (; has Stack IR ;) (result i32) + (func $_memchr (; 15 ;) (; has Stack IR ;) (result i32) (local $0 i32) (local $1 i32) (local $2 i32) @@ -356,11 +338,9 @@ (get_local $0) ) ) - (func $keepAlive (; 17 ;) (; has Stack IR ;) + (func $keepAlive (; 16 ;) (; has Stack IR ;) (call $stores) (call $stores) - (call $test) - (call $test) (drop (call $imports) ) @@ -421,7 +401,7 @@ (call $_memchr) ) ) - (func $legalstub$illegalParam (; 18 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) + (func $legalstub$illegalParam (; 17 ;) (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64) (call $illegalParam (get_local $0) (i64.or @@ -438,13 +418,13 @@ (get_local $3) ) ) - (func $legalstub$illegalResult (; 19 ;) (; has Stack IR ;) (result i32) + (func $legalstub$illegalResult (; 18 ;) (; has Stack IR ;) (result i32) (call $setTempRet0 (i32.const 2) ) (i32.const 1) ) - (func $legalfunc$illegalImport (; 20 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) + (func $legalfunc$illegalImport (; 19 ;) (; has Stack IR ;) (param $0 f64) (param $1 i64) (param $2 i32) (call $legalimport$illegalImport (get_local $0) (i32.wrap/i64 @@ -459,7 +439,7 @@ (get_local $2) ) ) - (func $legalfunc$_fabsf (; 21 ;) (; has Stack IR ;) (param $0 f32) (result f32) + (func $legalfunc$_fabsf (; 20 ;) (; has Stack IR ;) (param $0 f32) (result f32) (f32.demote/f64 (call $legalimport$_fabsf (f64.promote/f32 @@ -468,7 +448,7 @@ ) ) ) - (func $legalfunc$do_i64 (; 22 ;) (; has Stack IR ;) (result i64) + (func $legalfunc$do_i64 (; 21 ;) (; has Stack IR ;) (result i64) (i64.or (i64.extend_u/i32 (call $legalimport$do_i64) |