summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-05-01 10:21:22 -0700
committerGitHub <noreply@github.com>2018-05-01 10:21:22 -0700
commit16d3174db2f3b8c56600633156f9765bc3ad96b1 (patch)
treefb02111d1d9a6f2eb76d051f09b7bf246db95bb5
parent1bd0b00d54d9863449d357db7f390a24437bc537 (diff)
downloadbinaryen-16d3174db2f3b8c56600633156f9765bc3ad96b1.tar.gz
binaryen-16d3174db2f3b8c56600633156f9765bc3ad96b1.tar.bz2
binaryen-16d3174db2f3b8c56600633156f9765bc3ad96b1.zip
Generate loop return values in optimizer (#1527)
-rw-r--r--src/passes/SimplifyLocals.cpp24
-rw-r--r--test/emcc_O2_hello_world.fromasm867
-rw-r--r--test/emcc_O2_hello_world.fromasm.clamp867
-rw-r--r--test/emcc_O2_hello_world.fromasm.imprecise867
-rw-r--r--test/emcc_hello_world.fromasm4
-rw-r--r--test/emcc_hello_world.fromasm.clamp4
-rw-r--r--test/emcc_hello_world.fromasm.imprecise4
-rw-r--r--test/memorygrowth.fromasm464
-rw-r--r--test/memorygrowth.fromasm.clamp464
-rw-r--r--test/memorygrowth.fromasm.imprecise464
-rw-r--r--test/passes/inlining-optimizing_optimize-level=3.txt4
-rw-r--r--test/passes/simplify-locals.txt33
-rw-r--r--test/passes/simplify-locals.wast19
13 files changed, 2059 insertions, 2026 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp
index 6c1ea3fcb..6f8b346b5 100644
--- a/src/passes/SimplifyLocals.cpp
+++ b/src/passes/SimplifyLocals.cpp
@@ -201,6 +201,12 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals<a
}
}
+ void visitLoop(Loop* curr) {
+ if (allowStructure) {
+ loops.push_back(this->getCurrentPointer());
+ }
+ }
+
void visitGetLocal(GetLocal *curr) {
auto found = sinkables.find(curr->index);
if (found != sinkables.end()) {
@@ -335,6 +341,7 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals<a
std::vector<Block*> blocksToEnlarge;
std::vector<If*> ifsToEnlarge;
+ std::vector<Expression**> loops;
void optimizeBlockReturn(Block* block) {
if (!block->name.is() || unoptimizableBlocks.count(block->name) > 0) {
@@ -602,6 +609,23 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals<a
ifsToEnlarge.clear();
anotherCycle = true;
}
+ // handle loops (we can't modify set_locals in the main pass, as they are
+ // being tracked)
+ for (auto* currp : loops) {
+ auto* curr = (*currp)->template cast<Loop>();
+ // Optimizing a loop return value is trivial: just see if it contains
+ // a set_local, and pull that out.
+ if (auto* set = curr->body->template dynCast<SetLocal>()) {
+ if (isConcreteType(set->value->type)) {
+ curr->body = set->value;
+ set->value = curr;
+ curr->finalize(curr->body->type);
+ *currp = set;
+ anotherCycle = true;
+ }
+ }
+ }
+ loops.clear();
// clean up
sinkables.clear();
blockBreaks.clear();
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index 271013c8f..6b801760b 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -122,7 +122,7 @@
)
(tee_local $5
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(select
(i32.const 16)
(i32.and
@@ -157,7 +157,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.xor
(i32.and
@@ -202,7 +202,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 12)
@@ -213,7 +213,7 @@
)
(block
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $1)
)
(i32.store
@@ -231,7 +231,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -243,7 +243,7 @@
(i32.or
(tee_local $2
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
)
@@ -274,7 +274,7 @@
)
(if
(i32.gt_u
- (get_local $10)
+ (get_local $9)
(tee_local $6
(i32.load
(i32.const 184)
@@ -326,7 +326,7 @@
)
(set_local $1
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(tee_local $0
(i32.load
@@ -335,7 +335,7 @@
(tee_local $11
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.or
(i32.or
@@ -344,7 +344,7 @@
(tee_local $2
(i32.and
(i32.shr_u
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $2)
(get_local $1)
@@ -357,12 +357,12 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(tee_local $0
(i32.shr_u
- (get_local $8)
+ (get_local $10)
(get_local $2)
)
)
@@ -378,7 +378,7 @@
(tee_local $11
(i32.shr_u
(get_local $0)
- (get_local $8)
+ (get_local $10)
)
)
(i32.const 1)
@@ -476,7 +476,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -490,7 +490,7 @@
(i32.store offset=4
(get_local $0)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -498,17 +498,17 @@
(tee_local $15
(i32.add
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
)
(i32.or
(tee_local $6
(i32.sub
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -629,7 +629,7 @@
(get_local $15)
)
(return
- (get_local $8)
+ (get_local $10)
)
)
)
@@ -745,7 +745,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $5
@@ -792,7 +792,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(get_local $2)
@@ -835,7 +835,7 @@
(tee_local $5
(i32.add
(get_local $3)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -849,7 +849,7 @@
(block $do-once4
(if
(i32.eq
- (tee_local $8
+ (tee_local $10
(i32.load offset=12
(get_local $3)
)
@@ -859,7 +859,7 @@
(block
(set_local $6
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -871,7 +871,7 @@
)
(block (result i32)
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(get_local $0)
)
@@ -893,7 +893,7 @@
)
(loop $while-in7
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -905,7 +905,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -914,7 +914,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -926,7 +926,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -967,7 +967,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $0)
(i32.const 12)
@@ -983,7 +983,7 @@
(i32.load
(tee_local $11
(i32.add
- (get_local $8)
+ (get_local $10)
(i32.const 8)
)
)
@@ -992,15 +992,15 @@
)
(block
(i32.store
- (get_local $9)
(get_local $8)
+ (get_local $10)
)
(i32.store
(get_local $11)
(get_local $0)
)
(set_local $19
- (get_local $8)
+ (get_local $10)
)
)
(call $_abort)
@@ -1019,7 +1019,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.load offset=28
(get_local $3)
)
@@ -1050,7 +1050,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
(i32.const -1)
)
@@ -1073,7 +1073,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 16)
@@ -1083,7 +1083,7 @@
(get_local $3)
)
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $19)
)
(i32.store offset=20
@@ -1101,7 +1101,7 @@
(if
(i32.lt_u
(get_local $19)
- (tee_local $8
+ (tee_local $10
(i32.load
(i32.const 192)
)
@@ -1122,7 +1122,7 @@
(if
(i32.lt_u
(get_local $1)
- (get_local $8)
+ (get_local $10)
)
(call $_abort)
(block
@@ -1178,7 +1178,7 @@
(tee_local $2
(i32.add
(get_local $7)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 3)
@@ -1206,7 +1206,7 @@
(i32.store offset=4
(get_local $3)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -1239,7 +1239,7 @@
(set_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $1)
(i32.const 3)
@@ -1260,15 +1260,15 @@
(tee_local $11
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
)
)
(if
(i32.lt_u
- (tee_local $9
+ (tee_local $8
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $1)
(i32.const 8)
@@ -1283,10 +1283,10 @@
(call $_abort)
(block
(set_local $39
- (get_local $8)
+ (get_local $10)
)
(set_local $32
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1348,7 +1348,7 @@
)
)
)
- (set_local $10
+ (set_local $9
(if (result i32)
(i32.le_u
(get_local $0)
@@ -1384,9 +1384,9 @@
(tee_local $15
(i32.load offset=480
(i32.shl
- (tee_local $10
+ (tee_local $9
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.shr_u
(get_local $1)
(i32.const 8)
@@ -1409,18 +1409,18 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
- (tee_local $8
+ (tee_local $10
(i32.shl
- (get_local $9)
+ (get_local $8)
(tee_local $1
(i32.and
(i32.shr_u
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 1048320)
)
(i32.const 16)
@@ -1439,14 +1439,14 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(i32.add
(tee_local $17
(i32.shl
+ (get_local $10)
(get_local $8)
- (get_local $9)
)
)
(i32.const 245760)
@@ -1461,7 +1461,7 @@
(i32.shr_u
(i32.shl
(get_local $17)
- (get_local $8)
+ (get_local $10)
)
(i32.const 15)
)
@@ -1486,7 +1486,7 @@
)
)
(block
- (set_local $8
+ (set_local $10
(get_local $0)
)
(set_local $17
@@ -1500,18 +1500,18 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(i32.const 1)
)
)
(i32.eq
- (get_local $10)
+ (get_local $9)
(i32.const 31)
)
)
)
)
- (set_local $9
+ (set_local $8
(get_local $15)
)
(loop $while-in14
@@ -1522,7 +1522,7 @@
(tee_local $19
(i32.and
(i32.load offset=4
- (get_local $9)
+ (get_local $8)
)
(i32.const -8)
)
@@ -1530,7 +1530,7 @@
(get_local $2)
)
)
- (get_local $8)
+ (get_local $10)
)
(set_local $6
(if (result i32)
@@ -1543,21 +1543,21 @@
(get_local $0)
)
(set_local $25
- (get_local $9)
+ (get_local $8)
)
(set_local $29
- (get_local $9)
+ (get_local $8)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
(br $label$break$L123)
)
(block (result i32)
- (set_local $8
+ (set_local $10
(get_local $0)
)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1567,7 +1567,7 @@
(get_local $17)
(tee_local $0
(i32.load offset=20
- (get_local $9)
+ (get_local $8)
)
)
(i32.or
@@ -1576,11 +1576,11 @@
)
(i32.eq
(get_local $0)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.add
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 16)
)
(i32.shl
@@ -1601,17 +1601,17 @@
(if (result i32)
(tee_local $0
(i32.eqz
- (get_local $9)
+ (get_local $8)
)
)
(block (result i32)
(set_local $33
- (get_local $8)
+ (get_local $10)
)
(set_local $30
(get_local $6)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
(get_local $19)
@@ -1642,7 +1642,7 @@
(set_local $33
(get_local $0)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
)
@@ -1650,7 +1650,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 86)
)
(block
@@ -1671,7 +1671,7 @@
(tee_local $15
(i32.shl
(i32.const 2)
- (get_local $10)
+ (get_local $9)
)
)
(i32.sub
@@ -1683,7 +1683,7 @@
)
)
(block
- (set_local $10
+ (set_local $9
(get_local $2)
)
(br $do-once)
@@ -1720,7 +1720,7 @@
(tee_local $15
(i32.and
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(i32.shr_u
(get_local $15)
(get_local $0)
@@ -1733,12 +1733,12 @@
)
(get_local $0)
)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(tee_local $5
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(get_local $15)
)
)
@@ -1754,7 +1754,7 @@
(tee_local $6
(i32.shr_u
(get_local $5)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -1801,7 +1801,7 @@
(set_local $29
(get_local $30)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
)
@@ -1818,11 +1818,11 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 90)
)
(loop $while-in16
- (set_local $8
+ (set_local $10
(i32.const 0)
)
(set_local $1
@@ -1958,7 +1958,7 @@
(if (result i32)
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $12)
(i32.const 20)
@@ -1970,7 +1970,7 @@
(set_local $17
(get_local $0)
)
- (get_local $10)
+ (get_local $9)
)
(if (result i32)
(tee_local $17
@@ -1992,7 +1992,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 20)
@@ -2005,7 +2005,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2013,7 +2013,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 16)
@@ -2026,7 +2026,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2052,7 +2052,7 @@
(block
(if
(i32.lt_u
- (tee_local $10
+ (tee_local $9
(i32.load offset=8
(get_local $12)
)
@@ -2066,7 +2066,7 @@
(i32.load
(tee_local $0
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 12)
)
)
@@ -2094,7 +2094,7 @@
)
(i32.store
(get_local $15)
- (get_local $10)
+ (get_local $9)
)
(set_local $7
(get_local $1)
@@ -2319,7 +2319,7 @@
(i32.const 176)
)
)
- (tee_local $10
+ (tee_local $9
(i32.shl
(i32.const 1)
(get_local $5)
@@ -2357,7 +2357,7 @@
(i32.const 176)
(i32.or
(get_local $1)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $16
@@ -2393,7 +2393,7 @@
(set_local $5
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(if (result i32)
(tee_local $11
(i32.shr_u
@@ -2425,7 +2425,7 @@
(tee_local $1
(i32.shl
(get_local $11)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(i32.add
@@ -2446,7 +2446,7 @@
(i32.const 4)
)
)
- (get_local $10)
+ (get_local $9)
)
(tee_local $1
(i32.and
@@ -2497,7 +2497,7 @@
)
(i32.store offset=28
(get_local $6)
- (get_local $9)
+ (get_local $8)
)
(i32.store offset=4
(tee_local $1
@@ -2523,7 +2523,7 @@
(tee_local $15
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -2563,12 +2563,12 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $9)
+ (get_local $8)
(i32.const 1)
)
)
(i32.eq
- (get_local $9)
+ (get_local $8)
(i32.const 31)
)
)
@@ -2579,76 +2579,75 @@
(get_local $5)
)
)
- (loop $while-in28
- (set_local $8
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $3)
+ )
+ (block
+ (set_local $14
+ (get_local $1)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $3)
- )
- (block
- (set_local $14
- (get_local $1)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $10
- (i32.load
- (tee_local $5
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $9
+ (i32.load
+ (tee_local $5
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $15)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $15
(i32.shl
- (i32.shr_u
- (get_local $15)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $15)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $9)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $15
- (i32.shl
- (get_local $15)
- (i32.const 1)
+ (block (result i32)
+ (set_local $23
+ (get_local $5)
+ )
+ (set_local $21
+ (get_local $1)
+ )
+ (i32.const 145)
)
)
- (set_local $1
- (get_local $10)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $23
- (get_local $5)
- )
- (set_local $21
- (get_local $1)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 145)
)
(if
@@ -2680,7 +2679,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 148)
)
(if
@@ -2696,7 +2695,7 @@
)
)
)
- (tee_local $10
+ (tee_local $9
(i32.load
(i32.const 192)
)
@@ -2704,7 +2703,7 @@
)
(i32.ge_u
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
(block
@@ -2792,7 +2791,7 @@
(i32.const 184)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(set_local $14
@@ -2805,7 +2804,7 @@
(tee_local $3
(i32.sub
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 15)
@@ -2816,7 +2815,7 @@
(tee_local $21
(i32.add
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2841,7 +2840,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -2896,7 +2895,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -2904,7 +2903,7 @@
(tee_local $3
(i32.sub
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2917,7 +2916,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2931,7 +2930,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3004,7 +3003,7 @@
)
(set_local $14
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 48)
)
)
@@ -3021,7 +3020,7 @@
)
(tee_local $12
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 47)
)
)
@@ -3035,7 +3034,7 @@
)
)
)
- (get_local $10)
+ (get_local $9)
)
(return
(i32.const 0)
@@ -3043,7 +3042,7 @@
)
(if
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 616)
)
@@ -3064,7 +3063,7 @@
)
(i32.gt_u
(get_local $16)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 0)
@@ -3083,7 +3082,7 @@
)
(i32.const 0)
(i32.eq
- (tee_local $8
+ (tee_local $10
(block $label$break$L257 (result i32)
(if
(i32.eqz
@@ -3097,7 +3096,7 @@
(block
(block $label$break$L259
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 200)
)
@@ -3116,7 +3115,7 @@
(get_local $16)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.gt_u
(i32.add
@@ -3130,7 +3129,7 @@
)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.const 0)
)
@@ -3151,7 +3150,7 @@
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
(br $label$break$L259)
@@ -3212,14 +3211,14 @@
(set_local $18
(get_local $16)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
)
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
)
@@ -3228,11 +3227,11 @@
(if
(if (result i32)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 173)
)
(i32.ne
- (tee_local $9
+ (tee_local $8
(call $_sbrk
(i32.const 0)
)
@@ -3256,7 +3255,7 @@
)
)
(tee_local $2
- (get_local $9)
+ (get_local $8)
)
)
(i32.add
@@ -3292,7 +3291,7 @@
(i32.and
(i32.gt_u
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
(i32.lt_u
(get_local $0)
@@ -3328,11 +3327,11 @@
(get_local $0)
)
)
- (get_local $9)
+ (get_local $8)
)
(block
(set_local $20
- (get_local $9)
+ (get_local $8)
)
(set_local $22
(get_local $0)
@@ -3345,7 +3344,7 @@
(set_local $13
(get_local $7)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
(get_local $0)
@@ -3360,7 +3359,7 @@
(block $label$break$L279
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 183)
)
(block
@@ -3397,7 +3396,7 @@
(get_local $12)
(get_local $18)
)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 656)
)
@@ -3405,7 +3404,7 @@
)
(i32.sub
(i32.const 0)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -3507,7 +3506,7 @@
)
)
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 40)
)
)
@@ -3520,14 +3519,14 @@
(set_local $22
(get_local $13)
)
- (set_local $8
+ (set_local $10
(i32.const 193)
)
)
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 193)
)
(block
@@ -3601,7 +3600,7 @@
(set_local $49
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 203)
)
(br $do-out)
@@ -3620,7 +3619,7 @@
(if (result i32)
(if (result i32)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 203)
)
(i32.eqz
@@ -3766,7 +3765,7 @@
(set_local $40
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 211)
)
(br $while-out42)
@@ -3786,7 +3785,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 211)
)
(set_local $28
@@ -3868,7 +3867,7 @@
(set_local $4
(i32.add
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $14
@@ -3877,13 +3876,13 @@
(get_local $3)
(get_local $12)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.store offset=4
(get_local $12)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3984,7 +3983,7 @@
(block
(set_local $0
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4003,7 +4002,7 @@
(set_local $7
(get_local $2)
)
- (get_local $9)
+ (get_local $8)
)
(if (result i32)
(tee_local $16
@@ -4018,7 +4017,7 @@
)
(loop $while-in50
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4030,7 +4029,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4039,7 +4038,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4051,7 +4050,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4092,7 +4091,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $2)
(i32.const 12)
@@ -4117,7 +4116,7 @@
)
(block
(i32.store
- (get_local $9)
+ (get_local $8)
(get_local $21)
)
(i32.store
@@ -4498,7 +4497,7 @@
(block
(if
(i32.ge_u
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $5
(i32.add
@@ -4517,7 +4516,7 @@
(get_local $5)
)
(set_local $34
- (get_local $9)
+ (get_local $8)
)
(br $do-once59)
)
@@ -4596,7 +4595,7 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
@@ -4633,7 +4632,7 @@
(tee_local $5
(i32.shl
(get_local $1)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 245760)
@@ -4758,76 +4757,75 @@
(get_local $2)
)
)
- (loop $while-in64
- (set_local $8
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $14)
+ )
+ (block
+ (set_local $35
+ (get_local $0)
+ )
+ (br $while-out63
+ (i32.const 281)
+ )
)
- (i32.const -8)
- )
- (get_local $14)
- )
- (block
- (set_local $35
- (get_local $0)
- )
- (br $while-out63
- (i32.const 281)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $2
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $2
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $16)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $16
(i32.shl
- (i32.shr_u
- (get_local $16)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $16)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $16
- (i32.shl
- (get_local $16)
- (i32.const 1)
+ (block (result i32)
+ (set_local $43
+ (get_local $2)
+ )
+ (set_local $51
+ (get_local $0)
+ )
+ (i32.const 278)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $43
- (get_local $2)
- )
- (set_local $51
- (get_local $0)
- )
- (i32.const 278)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 278)
)
(if
@@ -4859,7 +4857,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 281)
)
(if
@@ -4949,48 +4947,47 @@
)
)
)
- (loop $while-in66
- (set_local $0
- (if (result i32)
- (if (result i32)
- (i32.le_u
- (tee_local $4
- (i32.load
- (get_local $28)
- )
- )
- (get_local $13)
- )
- (i32.gt_u
- (tee_local $14
- (i32.add
- (get_local $4)
- (i32.load offset=4
- (get_local $28)
- )
- )
- )
- (get_local $13)
- )
- (i32.const 0)
- )
- (get_local $14)
- (block
- (set_local $28
- (i32.load offset=8
- (get_local $28)
- )
- )
- (br $while-in66)
- )
- )
- )
- )
(set_local $14
(i32.add
(tee_local $12
(i32.add
- (get_local $0)
+ (tee_local $0
+ (loop $while-in66 (result i32)
+ (if (result i32)
+ (if (result i32)
+ (i32.le_u
+ (tee_local $4
+ (i32.load
+ (get_local $28)
+ )
+ )
+ (get_local $13)
+ )
+ (i32.gt_u
+ (tee_local $14
+ (i32.add
+ (get_local $4)
+ (i32.load offset=4
+ (get_local $28)
+ )
+ )
+ )
+ (get_local $13)
+ )
+ (i32.const 0)
+ )
+ (get_local $14)
+ (block
+ (set_local $28
+ (i32.load offset=8
+ (get_local $28)
+ )
+ )
+ (br $while-in66)
+ )
+ )
+ )
+ )
(i32.const -47)
)
)
@@ -5485,76 +5482,75 @@
(get_local $3)
)
)
- (loop $while-in70
- (set_local $8
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $4)
+ )
+ (block
+ (set_local $37
+ (get_local $0)
+ )
+ (br $while-out69
+ (i32.const 307)
+ )
)
- (i32.const -8)
- )
- (get_local $4)
- )
- (block
- (set_local $37
- (get_local $0)
- )
- (br $while-out69
- (i32.const 307)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $3
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $3
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $2)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $2
(i32.shl
- (i32.shr_u
- (get_local $2)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $2)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $2
- (i32.shl
- (get_local $2)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $3)
+ )
+ (set_local $52
+ (get_local $0)
+ )
+ (i32.const 304)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $45
- (get_local $3)
- )
- (set_local $52
- (get_local $0)
- )
- (i32.const 304)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 304)
)
(if
@@ -5586,7 +5582,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 307)
)
(if
@@ -5787,7 +5783,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -5795,7 +5791,7 @@
(tee_local $20
(i32.sub
(get_local $22)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5808,7 +5804,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5822,7 +5818,7 @@
(i32.store offset=4
(get_local $22)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -7442,76 +7438,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $17
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $17
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $16
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $16
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $3)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $16)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $3)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $16)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8430,8 +8425,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/emcc_O2_hello_world.fromasm.clamp b/test/emcc_O2_hello_world.fromasm.clamp
index 271013c8f..6b801760b 100644
--- a/test/emcc_O2_hello_world.fromasm.clamp
+++ b/test/emcc_O2_hello_world.fromasm.clamp
@@ -122,7 +122,7 @@
)
(tee_local $5
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(select
(i32.const 16)
(i32.and
@@ -157,7 +157,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.xor
(i32.and
@@ -202,7 +202,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 12)
@@ -213,7 +213,7 @@
)
(block
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $1)
)
(i32.store
@@ -231,7 +231,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -243,7 +243,7 @@
(i32.or
(tee_local $2
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
)
@@ -274,7 +274,7 @@
)
(if
(i32.gt_u
- (get_local $10)
+ (get_local $9)
(tee_local $6
(i32.load
(i32.const 184)
@@ -326,7 +326,7 @@
)
(set_local $1
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(tee_local $0
(i32.load
@@ -335,7 +335,7 @@
(tee_local $11
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.or
(i32.or
@@ -344,7 +344,7 @@
(tee_local $2
(i32.and
(i32.shr_u
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $2)
(get_local $1)
@@ -357,12 +357,12 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(tee_local $0
(i32.shr_u
- (get_local $8)
+ (get_local $10)
(get_local $2)
)
)
@@ -378,7 +378,7 @@
(tee_local $11
(i32.shr_u
(get_local $0)
- (get_local $8)
+ (get_local $10)
)
)
(i32.const 1)
@@ -476,7 +476,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -490,7 +490,7 @@
(i32.store offset=4
(get_local $0)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -498,17 +498,17 @@
(tee_local $15
(i32.add
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
)
(i32.or
(tee_local $6
(i32.sub
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -629,7 +629,7 @@
(get_local $15)
)
(return
- (get_local $8)
+ (get_local $10)
)
)
)
@@ -745,7 +745,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $5
@@ -792,7 +792,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(get_local $2)
@@ -835,7 +835,7 @@
(tee_local $5
(i32.add
(get_local $3)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -849,7 +849,7 @@
(block $do-once4
(if
(i32.eq
- (tee_local $8
+ (tee_local $10
(i32.load offset=12
(get_local $3)
)
@@ -859,7 +859,7 @@
(block
(set_local $6
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -871,7 +871,7 @@
)
(block (result i32)
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(get_local $0)
)
@@ -893,7 +893,7 @@
)
(loop $while-in7
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -905,7 +905,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -914,7 +914,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -926,7 +926,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -967,7 +967,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $0)
(i32.const 12)
@@ -983,7 +983,7 @@
(i32.load
(tee_local $11
(i32.add
- (get_local $8)
+ (get_local $10)
(i32.const 8)
)
)
@@ -992,15 +992,15 @@
)
(block
(i32.store
- (get_local $9)
(get_local $8)
+ (get_local $10)
)
(i32.store
(get_local $11)
(get_local $0)
)
(set_local $19
- (get_local $8)
+ (get_local $10)
)
)
(call $_abort)
@@ -1019,7 +1019,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.load offset=28
(get_local $3)
)
@@ -1050,7 +1050,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
(i32.const -1)
)
@@ -1073,7 +1073,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 16)
@@ -1083,7 +1083,7 @@
(get_local $3)
)
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $19)
)
(i32.store offset=20
@@ -1101,7 +1101,7 @@
(if
(i32.lt_u
(get_local $19)
- (tee_local $8
+ (tee_local $10
(i32.load
(i32.const 192)
)
@@ -1122,7 +1122,7 @@
(if
(i32.lt_u
(get_local $1)
- (get_local $8)
+ (get_local $10)
)
(call $_abort)
(block
@@ -1178,7 +1178,7 @@
(tee_local $2
(i32.add
(get_local $7)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 3)
@@ -1206,7 +1206,7 @@
(i32.store offset=4
(get_local $3)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -1239,7 +1239,7 @@
(set_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $1)
(i32.const 3)
@@ -1260,15 +1260,15 @@
(tee_local $11
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
)
)
(if
(i32.lt_u
- (tee_local $9
+ (tee_local $8
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $1)
(i32.const 8)
@@ -1283,10 +1283,10 @@
(call $_abort)
(block
(set_local $39
- (get_local $8)
+ (get_local $10)
)
(set_local $32
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1348,7 +1348,7 @@
)
)
)
- (set_local $10
+ (set_local $9
(if (result i32)
(i32.le_u
(get_local $0)
@@ -1384,9 +1384,9 @@
(tee_local $15
(i32.load offset=480
(i32.shl
- (tee_local $10
+ (tee_local $9
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.shr_u
(get_local $1)
(i32.const 8)
@@ -1409,18 +1409,18 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
- (tee_local $8
+ (tee_local $10
(i32.shl
- (get_local $9)
+ (get_local $8)
(tee_local $1
(i32.and
(i32.shr_u
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 1048320)
)
(i32.const 16)
@@ -1439,14 +1439,14 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(i32.add
(tee_local $17
(i32.shl
+ (get_local $10)
(get_local $8)
- (get_local $9)
)
)
(i32.const 245760)
@@ -1461,7 +1461,7 @@
(i32.shr_u
(i32.shl
(get_local $17)
- (get_local $8)
+ (get_local $10)
)
(i32.const 15)
)
@@ -1486,7 +1486,7 @@
)
)
(block
- (set_local $8
+ (set_local $10
(get_local $0)
)
(set_local $17
@@ -1500,18 +1500,18 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(i32.const 1)
)
)
(i32.eq
- (get_local $10)
+ (get_local $9)
(i32.const 31)
)
)
)
)
- (set_local $9
+ (set_local $8
(get_local $15)
)
(loop $while-in14
@@ -1522,7 +1522,7 @@
(tee_local $19
(i32.and
(i32.load offset=4
- (get_local $9)
+ (get_local $8)
)
(i32.const -8)
)
@@ -1530,7 +1530,7 @@
(get_local $2)
)
)
- (get_local $8)
+ (get_local $10)
)
(set_local $6
(if (result i32)
@@ -1543,21 +1543,21 @@
(get_local $0)
)
(set_local $25
- (get_local $9)
+ (get_local $8)
)
(set_local $29
- (get_local $9)
+ (get_local $8)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
(br $label$break$L123)
)
(block (result i32)
- (set_local $8
+ (set_local $10
(get_local $0)
)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1567,7 +1567,7 @@
(get_local $17)
(tee_local $0
(i32.load offset=20
- (get_local $9)
+ (get_local $8)
)
)
(i32.or
@@ -1576,11 +1576,11 @@
)
(i32.eq
(get_local $0)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.add
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 16)
)
(i32.shl
@@ -1601,17 +1601,17 @@
(if (result i32)
(tee_local $0
(i32.eqz
- (get_local $9)
+ (get_local $8)
)
)
(block (result i32)
(set_local $33
- (get_local $8)
+ (get_local $10)
)
(set_local $30
(get_local $6)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
(get_local $19)
@@ -1642,7 +1642,7 @@
(set_local $33
(get_local $0)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
)
@@ -1650,7 +1650,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 86)
)
(block
@@ -1671,7 +1671,7 @@
(tee_local $15
(i32.shl
(i32.const 2)
- (get_local $10)
+ (get_local $9)
)
)
(i32.sub
@@ -1683,7 +1683,7 @@
)
)
(block
- (set_local $10
+ (set_local $9
(get_local $2)
)
(br $do-once)
@@ -1720,7 +1720,7 @@
(tee_local $15
(i32.and
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(i32.shr_u
(get_local $15)
(get_local $0)
@@ -1733,12 +1733,12 @@
)
(get_local $0)
)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(tee_local $5
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(get_local $15)
)
)
@@ -1754,7 +1754,7 @@
(tee_local $6
(i32.shr_u
(get_local $5)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -1801,7 +1801,7 @@
(set_local $29
(get_local $30)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
)
@@ -1818,11 +1818,11 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 90)
)
(loop $while-in16
- (set_local $8
+ (set_local $10
(i32.const 0)
)
(set_local $1
@@ -1958,7 +1958,7 @@
(if (result i32)
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $12)
(i32.const 20)
@@ -1970,7 +1970,7 @@
(set_local $17
(get_local $0)
)
- (get_local $10)
+ (get_local $9)
)
(if (result i32)
(tee_local $17
@@ -1992,7 +1992,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 20)
@@ -2005,7 +2005,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2013,7 +2013,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 16)
@@ -2026,7 +2026,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2052,7 +2052,7 @@
(block
(if
(i32.lt_u
- (tee_local $10
+ (tee_local $9
(i32.load offset=8
(get_local $12)
)
@@ -2066,7 +2066,7 @@
(i32.load
(tee_local $0
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 12)
)
)
@@ -2094,7 +2094,7 @@
)
(i32.store
(get_local $15)
- (get_local $10)
+ (get_local $9)
)
(set_local $7
(get_local $1)
@@ -2319,7 +2319,7 @@
(i32.const 176)
)
)
- (tee_local $10
+ (tee_local $9
(i32.shl
(i32.const 1)
(get_local $5)
@@ -2357,7 +2357,7 @@
(i32.const 176)
(i32.or
(get_local $1)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $16
@@ -2393,7 +2393,7 @@
(set_local $5
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(if (result i32)
(tee_local $11
(i32.shr_u
@@ -2425,7 +2425,7 @@
(tee_local $1
(i32.shl
(get_local $11)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(i32.add
@@ -2446,7 +2446,7 @@
(i32.const 4)
)
)
- (get_local $10)
+ (get_local $9)
)
(tee_local $1
(i32.and
@@ -2497,7 +2497,7 @@
)
(i32.store offset=28
(get_local $6)
- (get_local $9)
+ (get_local $8)
)
(i32.store offset=4
(tee_local $1
@@ -2523,7 +2523,7 @@
(tee_local $15
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -2563,12 +2563,12 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $9)
+ (get_local $8)
(i32.const 1)
)
)
(i32.eq
- (get_local $9)
+ (get_local $8)
(i32.const 31)
)
)
@@ -2579,76 +2579,75 @@
(get_local $5)
)
)
- (loop $while-in28
- (set_local $8
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $3)
+ )
+ (block
+ (set_local $14
+ (get_local $1)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $3)
- )
- (block
- (set_local $14
- (get_local $1)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $10
- (i32.load
- (tee_local $5
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $9
+ (i32.load
+ (tee_local $5
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $15)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $15
(i32.shl
- (i32.shr_u
- (get_local $15)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $15)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $9)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $15
- (i32.shl
- (get_local $15)
- (i32.const 1)
+ (block (result i32)
+ (set_local $23
+ (get_local $5)
+ )
+ (set_local $21
+ (get_local $1)
+ )
+ (i32.const 145)
)
)
- (set_local $1
- (get_local $10)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $23
- (get_local $5)
- )
- (set_local $21
- (get_local $1)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 145)
)
(if
@@ -2680,7 +2679,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 148)
)
(if
@@ -2696,7 +2695,7 @@
)
)
)
- (tee_local $10
+ (tee_local $9
(i32.load
(i32.const 192)
)
@@ -2704,7 +2703,7 @@
)
(i32.ge_u
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
(block
@@ -2792,7 +2791,7 @@
(i32.const 184)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(set_local $14
@@ -2805,7 +2804,7 @@
(tee_local $3
(i32.sub
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 15)
@@ -2816,7 +2815,7 @@
(tee_local $21
(i32.add
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2841,7 +2840,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -2896,7 +2895,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -2904,7 +2903,7 @@
(tee_local $3
(i32.sub
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2917,7 +2916,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2931,7 +2930,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3004,7 +3003,7 @@
)
(set_local $14
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 48)
)
)
@@ -3021,7 +3020,7 @@
)
(tee_local $12
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 47)
)
)
@@ -3035,7 +3034,7 @@
)
)
)
- (get_local $10)
+ (get_local $9)
)
(return
(i32.const 0)
@@ -3043,7 +3042,7 @@
)
(if
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 616)
)
@@ -3064,7 +3063,7 @@
)
(i32.gt_u
(get_local $16)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 0)
@@ -3083,7 +3082,7 @@
)
(i32.const 0)
(i32.eq
- (tee_local $8
+ (tee_local $10
(block $label$break$L257 (result i32)
(if
(i32.eqz
@@ -3097,7 +3096,7 @@
(block
(block $label$break$L259
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 200)
)
@@ -3116,7 +3115,7 @@
(get_local $16)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.gt_u
(i32.add
@@ -3130,7 +3129,7 @@
)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.const 0)
)
@@ -3151,7 +3150,7 @@
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
(br $label$break$L259)
@@ -3212,14 +3211,14 @@
(set_local $18
(get_local $16)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
)
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
)
@@ -3228,11 +3227,11 @@
(if
(if (result i32)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 173)
)
(i32.ne
- (tee_local $9
+ (tee_local $8
(call $_sbrk
(i32.const 0)
)
@@ -3256,7 +3255,7 @@
)
)
(tee_local $2
- (get_local $9)
+ (get_local $8)
)
)
(i32.add
@@ -3292,7 +3291,7 @@
(i32.and
(i32.gt_u
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
(i32.lt_u
(get_local $0)
@@ -3328,11 +3327,11 @@
(get_local $0)
)
)
- (get_local $9)
+ (get_local $8)
)
(block
(set_local $20
- (get_local $9)
+ (get_local $8)
)
(set_local $22
(get_local $0)
@@ -3345,7 +3344,7 @@
(set_local $13
(get_local $7)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
(get_local $0)
@@ -3360,7 +3359,7 @@
(block $label$break$L279
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 183)
)
(block
@@ -3397,7 +3396,7 @@
(get_local $12)
(get_local $18)
)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 656)
)
@@ -3405,7 +3404,7 @@
)
(i32.sub
(i32.const 0)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -3507,7 +3506,7 @@
)
)
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 40)
)
)
@@ -3520,14 +3519,14 @@
(set_local $22
(get_local $13)
)
- (set_local $8
+ (set_local $10
(i32.const 193)
)
)
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 193)
)
(block
@@ -3601,7 +3600,7 @@
(set_local $49
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 203)
)
(br $do-out)
@@ -3620,7 +3619,7 @@
(if (result i32)
(if (result i32)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 203)
)
(i32.eqz
@@ -3766,7 +3765,7 @@
(set_local $40
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 211)
)
(br $while-out42)
@@ -3786,7 +3785,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 211)
)
(set_local $28
@@ -3868,7 +3867,7 @@
(set_local $4
(i32.add
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $14
@@ -3877,13 +3876,13 @@
(get_local $3)
(get_local $12)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.store offset=4
(get_local $12)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3984,7 +3983,7 @@
(block
(set_local $0
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4003,7 +4002,7 @@
(set_local $7
(get_local $2)
)
- (get_local $9)
+ (get_local $8)
)
(if (result i32)
(tee_local $16
@@ -4018,7 +4017,7 @@
)
(loop $while-in50
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4030,7 +4029,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4039,7 +4038,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4051,7 +4050,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4092,7 +4091,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $2)
(i32.const 12)
@@ -4117,7 +4116,7 @@
)
(block
(i32.store
- (get_local $9)
+ (get_local $8)
(get_local $21)
)
(i32.store
@@ -4498,7 +4497,7 @@
(block
(if
(i32.ge_u
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $5
(i32.add
@@ -4517,7 +4516,7 @@
(get_local $5)
)
(set_local $34
- (get_local $9)
+ (get_local $8)
)
(br $do-once59)
)
@@ -4596,7 +4595,7 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
@@ -4633,7 +4632,7 @@
(tee_local $5
(i32.shl
(get_local $1)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 245760)
@@ -4758,76 +4757,75 @@
(get_local $2)
)
)
- (loop $while-in64
- (set_local $8
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $14)
+ )
+ (block
+ (set_local $35
+ (get_local $0)
+ )
+ (br $while-out63
+ (i32.const 281)
+ )
)
- (i32.const -8)
- )
- (get_local $14)
- )
- (block
- (set_local $35
- (get_local $0)
- )
- (br $while-out63
- (i32.const 281)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $2
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $2
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $16)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $16
(i32.shl
- (i32.shr_u
- (get_local $16)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $16)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $16
- (i32.shl
- (get_local $16)
- (i32.const 1)
+ (block (result i32)
+ (set_local $43
+ (get_local $2)
+ )
+ (set_local $51
+ (get_local $0)
+ )
+ (i32.const 278)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $43
- (get_local $2)
- )
- (set_local $51
- (get_local $0)
- )
- (i32.const 278)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 278)
)
(if
@@ -4859,7 +4857,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 281)
)
(if
@@ -4949,48 +4947,47 @@
)
)
)
- (loop $while-in66
- (set_local $0
- (if (result i32)
- (if (result i32)
- (i32.le_u
- (tee_local $4
- (i32.load
- (get_local $28)
- )
- )
- (get_local $13)
- )
- (i32.gt_u
- (tee_local $14
- (i32.add
- (get_local $4)
- (i32.load offset=4
- (get_local $28)
- )
- )
- )
- (get_local $13)
- )
- (i32.const 0)
- )
- (get_local $14)
- (block
- (set_local $28
- (i32.load offset=8
- (get_local $28)
- )
- )
- (br $while-in66)
- )
- )
- )
- )
(set_local $14
(i32.add
(tee_local $12
(i32.add
- (get_local $0)
+ (tee_local $0
+ (loop $while-in66 (result i32)
+ (if (result i32)
+ (if (result i32)
+ (i32.le_u
+ (tee_local $4
+ (i32.load
+ (get_local $28)
+ )
+ )
+ (get_local $13)
+ )
+ (i32.gt_u
+ (tee_local $14
+ (i32.add
+ (get_local $4)
+ (i32.load offset=4
+ (get_local $28)
+ )
+ )
+ )
+ (get_local $13)
+ )
+ (i32.const 0)
+ )
+ (get_local $14)
+ (block
+ (set_local $28
+ (i32.load offset=8
+ (get_local $28)
+ )
+ )
+ (br $while-in66)
+ )
+ )
+ )
+ )
(i32.const -47)
)
)
@@ -5485,76 +5482,75 @@
(get_local $3)
)
)
- (loop $while-in70
- (set_local $8
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $4)
+ )
+ (block
+ (set_local $37
+ (get_local $0)
+ )
+ (br $while-out69
+ (i32.const 307)
+ )
)
- (i32.const -8)
- )
- (get_local $4)
- )
- (block
- (set_local $37
- (get_local $0)
- )
- (br $while-out69
- (i32.const 307)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $3
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $3
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $2)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $2
(i32.shl
- (i32.shr_u
- (get_local $2)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $2)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $2
- (i32.shl
- (get_local $2)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $3)
+ )
+ (set_local $52
+ (get_local $0)
+ )
+ (i32.const 304)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $45
- (get_local $3)
- )
- (set_local $52
- (get_local $0)
- )
- (i32.const 304)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 304)
)
(if
@@ -5586,7 +5582,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 307)
)
(if
@@ -5787,7 +5783,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -5795,7 +5791,7 @@
(tee_local $20
(i32.sub
(get_local $22)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5808,7 +5804,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5822,7 +5818,7 @@
(i32.store offset=4
(get_local $22)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -7442,76 +7438,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $17
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $17
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $16
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $16
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $3)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $16)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $3)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $16)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8430,8 +8425,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise
index 5701f97bd..0203bf558 100644
--- a/test/emcc_O2_hello_world.fromasm.imprecise
+++ b/test/emcc_O2_hello_world.fromasm.imprecise
@@ -121,7 +121,7 @@
)
(tee_local $5
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(select
(i32.const 16)
(i32.and
@@ -156,7 +156,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.xor
(i32.and
@@ -201,7 +201,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 12)
@@ -212,7 +212,7 @@
)
(block
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $1)
)
(i32.store
@@ -230,7 +230,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -242,7 +242,7 @@
(i32.or
(tee_local $2
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
)
@@ -273,7 +273,7 @@
)
(if
(i32.gt_u
- (get_local $10)
+ (get_local $9)
(tee_local $6
(i32.load
(i32.const 184)
@@ -325,7 +325,7 @@
)
(set_local $1
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(tee_local $0
(i32.load
@@ -334,7 +334,7 @@
(tee_local $11
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(i32.add
(i32.or
(i32.or
@@ -343,7 +343,7 @@
(tee_local $2
(i32.and
(i32.shr_u
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $2)
(get_local $1)
@@ -356,12 +356,12 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(tee_local $0
(i32.shr_u
- (get_local $8)
+ (get_local $10)
(get_local $2)
)
)
@@ -377,7 +377,7 @@
(tee_local $11
(i32.shr_u
(get_local $0)
- (get_local $8)
+ (get_local $10)
)
)
(i32.const 1)
@@ -475,7 +475,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
(i32.const -1)
)
@@ -489,7 +489,7 @@
(i32.store offset=4
(get_local $0)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -497,17 +497,17 @@
(tee_local $15
(i32.add
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
)
(i32.or
(tee_local $6
(i32.sub
(i32.shl
- (get_local $9)
+ (get_local $8)
(i32.const 3)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -628,7 +628,7 @@
(get_local $15)
)
(return
- (get_local $8)
+ (get_local $10)
)
)
)
@@ -744,7 +744,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $5
@@ -791,7 +791,7 @@
)
(i32.const -8)
)
- (get_local $10)
+ (get_local $9)
)
)
(get_local $2)
@@ -834,7 +834,7 @@
(tee_local $5
(i32.add
(get_local $3)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -848,7 +848,7 @@
(block $do-once4
(if
(i32.eq
- (tee_local $8
+ (tee_local $10
(i32.load offset=12
(get_local $3)
)
@@ -858,7 +858,7 @@
(block
(set_local $6
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -870,7 +870,7 @@
)
(block (result i32)
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(get_local $0)
)
@@ -892,7 +892,7 @@
)
(loop $while-in7
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -904,7 +904,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -913,7 +913,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $0
(i32.add
@@ -925,7 +925,7 @@
)
(block
(set_local $17
- (get_local $9)
+ (get_local $8)
)
(set_local $6
(get_local $0)
@@ -966,7 +966,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $0)
(i32.const 12)
@@ -982,7 +982,7 @@
(i32.load
(tee_local $11
(i32.add
- (get_local $8)
+ (get_local $10)
(i32.const 8)
)
)
@@ -991,15 +991,15 @@
)
(block
(i32.store
- (get_local $9)
(get_local $8)
+ (get_local $10)
)
(i32.store
(get_local $11)
(get_local $0)
)
(set_local $19
- (get_local $8)
+ (get_local $10)
)
)
(call $_abort)
@@ -1018,7 +1018,7 @@
(tee_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.load offset=28
(get_local $3)
)
@@ -1049,7 +1049,7 @@
(i32.xor
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
(i32.const -1)
)
@@ -1072,7 +1072,7 @@
(if
(i32.eq
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $2)
(i32.const 16)
@@ -1082,7 +1082,7 @@
(get_local $3)
)
(i32.store
- (get_local $8)
+ (get_local $10)
(get_local $19)
)
(i32.store offset=20
@@ -1100,7 +1100,7 @@
(if
(i32.lt_u
(get_local $19)
- (tee_local $8
+ (tee_local $10
(i32.load
(i32.const 192)
)
@@ -1121,7 +1121,7 @@
(if
(i32.lt_u
(get_local $1)
- (get_local $8)
+ (get_local $10)
)
(call $_abort)
(block
@@ -1177,7 +1177,7 @@
(tee_local $2
(i32.add
(get_local $7)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 3)
@@ -1205,7 +1205,7 @@
(i32.store offset=4
(get_local $3)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -1238,7 +1238,7 @@
(set_local $1
(i32.add
(i32.shl
- (tee_local $8
+ (tee_local $10
(i32.shr_u
(get_local $1)
(i32.const 3)
@@ -1259,15 +1259,15 @@
(tee_local $11
(i32.shl
(i32.const 1)
- (get_local $8)
+ (get_local $10)
)
)
)
(if
(i32.lt_u
- (tee_local $9
+ (tee_local $8
(i32.load
- (tee_local $8
+ (tee_local $10
(i32.add
(get_local $1)
(i32.const 8)
@@ -1282,10 +1282,10 @@
(call $_abort)
(block
(set_local $39
- (get_local $8)
+ (get_local $10)
)
(set_local $32
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1347,7 +1347,7 @@
)
)
)
- (set_local $10
+ (set_local $9
(if (result i32)
(i32.le_u
(get_local $0)
@@ -1383,9 +1383,9 @@
(tee_local $15
(i32.load offset=480
(i32.shl
- (tee_local $10
+ (tee_local $9
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.shr_u
(get_local $1)
(i32.const 8)
@@ -1408,18 +1408,18 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
- (tee_local $8
+ (tee_local $10
(i32.shl
- (get_local $9)
+ (get_local $8)
(tee_local $1
(i32.and
(i32.shr_u
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 1048320)
)
(i32.const 16)
@@ -1438,14 +1438,14 @@
)
(get_local $1)
)
- (tee_local $8
+ (tee_local $10
(i32.and
(i32.shr_u
(i32.add
(tee_local $17
(i32.shl
+ (get_local $10)
(get_local $8)
- (get_local $9)
)
)
(i32.const 245760)
@@ -1460,7 +1460,7 @@
(i32.shr_u
(i32.shl
(get_local $17)
- (get_local $8)
+ (get_local $10)
)
(i32.const 15)
)
@@ -1485,7 +1485,7 @@
)
)
(block
- (set_local $8
+ (set_local $10
(get_local $0)
)
(set_local $17
@@ -1499,18 +1499,18 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(i32.const 1)
)
)
(i32.eq
- (get_local $10)
+ (get_local $9)
(i32.const 31)
)
)
)
)
- (set_local $9
+ (set_local $8
(get_local $15)
)
(loop $while-in14
@@ -1521,7 +1521,7 @@
(tee_local $19
(i32.and
(i32.load offset=4
- (get_local $9)
+ (get_local $8)
)
(i32.const -8)
)
@@ -1529,7 +1529,7 @@
(get_local $2)
)
)
- (get_local $8)
+ (get_local $10)
)
(set_local $6
(if (result i32)
@@ -1542,21 +1542,21 @@
(get_local $0)
)
(set_local $25
- (get_local $9)
+ (get_local $8)
)
(set_local $29
- (get_local $9)
+ (get_local $8)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
(br $label$break$L123)
)
(block (result i32)
- (set_local $8
+ (set_local $10
(get_local $0)
)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -1566,7 +1566,7 @@
(get_local $17)
(tee_local $0
(i32.load offset=20
- (get_local $9)
+ (get_local $8)
)
)
(i32.or
@@ -1575,11 +1575,11 @@
)
(i32.eq
(get_local $0)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.add
(i32.add
- (get_local $9)
+ (get_local $8)
(i32.const 16)
)
(i32.shl
@@ -1600,17 +1600,17 @@
(if (result i32)
(tee_local $0
(i32.eqz
- (get_local $9)
+ (get_local $8)
)
)
(block (result i32)
(set_local $33
- (get_local $8)
+ (get_local $10)
)
(set_local $30
(get_local $6)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
(get_local $19)
@@ -1641,7 +1641,7 @@
(set_local $33
(get_local $0)
)
- (set_local $8
+ (set_local $10
(i32.const 86)
)
)
@@ -1649,7 +1649,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 86)
)
(block
@@ -1670,7 +1670,7 @@
(tee_local $15
(i32.shl
(i32.const 2)
- (get_local $10)
+ (get_local $9)
)
)
(i32.sub
@@ -1682,7 +1682,7 @@
)
)
(block
- (set_local $10
+ (set_local $9
(get_local $2)
)
(br $do-once)
@@ -1719,7 +1719,7 @@
(tee_local $15
(i32.and
(i32.shr_u
- (tee_local $10
+ (tee_local $9
(i32.shr_u
(get_local $15)
(get_local $0)
@@ -1732,12 +1732,12 @@
)
(get_local $0)
)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(tee_local $5
(i32.shr_u
- (get_local $10)
+ (get_local $9)
(get_local $15)
)
)
@@ -1753,7 +1753,7 @@
(tee_local $6
(i32.shr_u
(get_local $5)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 1)
@@ -1800,7 +1800,7 @@
(set_local $29
(get_local $30)
)
- (set_local $8
+ (set_local $10
(i32.const 90)
)
)
@@ -1817,11 +1817,11 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 90)
)
(loop $while-in16
- (set_local $8
+ (set_local $10
(i32.const 0)
)
(set_local $1
@@ -1957,7 +1957,7 @@
(if (result i32)
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $12)
(i32.const 20)
@@ -1969,7 +1969,7 @@
(set_local $17
(get_local $0)
)
- (get_local $10)
+ (get_local $9)
)
(if (result i32)
(tee_local $17
@@ -1991,7 +1991,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 20)
@@ -2004,7 +2004,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2012,7 +2012,7 @@
(if
(tee_local $0
(i32.load
- (tee_local $10
+ (tee_local $9
(i32.add
(get_local $17)
(i32.const 16)
@@ -2025,7 +2025,7 @@
(get_local $0)
)
(set_local $1
- (get_local $10)
+ (get_local $9)
)
(br $while-in20)
)
@@ -2051,7 +2051,7 @@
(block
(if
(i32.lt_u
- (tee_local $10
+ (tee_local $9
(i32.load offset=8
(get_local $12)
)
@@ -2065,7 +2065,7 @@
(i32.load
(tee_local $0
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 12)
)
)
@@ -2093,7 +2093,7 @@
)
(i32.store
(get_local $15)
- (get_local $10)
+ (get_local $9)
)
(set_local $7
(get_local $1)
@@ -2318,7 +2318,7 @@
(i32.const 176)
)
)
- (tee_local $10
+ (tee_local $9
(i32.shl
(i32.const 1)
(get_local $5)
@@ -2356,7 +2356,7 @@
(i32.const 176)
(i32.or
(get_local $1)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $16
@@ -2392,7 +2392,7 @@
(set_local $5
(i32.add
(i32.shl
- (tee_local $9
+ (tee_local $8
(if (result i32)
(tee_local $11
(i32.shr_u
@@ -2424,7 +2424,7 @@
(tee_local $1
(i32.shl
(get_local $11)
- (tee_local $10
+ (tee_local $9
(i32.and
(i32.shr_u
(i32.add
@@ -2445,7 +2445,7 @@
(i32.const 4)
)
)
- (get_local $10)
+ (get_local $9)
)
(tee_local $1
(i32.and
@@ -2496,7 +2496,7 @@
)
(i32.store offset=28
(get_local $6)
- (get_local $9)
+ (get_local $8)
)
(i32.store offset=4
(tee_local $1
@@ -2522,7 +2522,7 @@
(tee_local $15
(i32.shl
(i32.const 1)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -2562,12 +2562,12 @@
(i32.sub
(i32.const 25)
(i32.shr_u
- (get_local $9)
+ (get_local $8)
(i32.const 1)
)
)
(i32.eq
- (get_local $9)
+ (get_local $8)
(i32.const 31)
)
)
@@ -2578,76 +2578,75 @@
(get_local $5)
)
)
- (loop $while-in28
- (set_local $8
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $3)
+ )
+ (block
+ (set_local $14
+ (get_local $1)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $3)
- )
- (block
- (set_local $14
- (get_local $1)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $10
- (i32.load
- (tee_local $5
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $9
+ (i32.load
+ (tee_local $5
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $15)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $15
(i32.shl
- (i32.shr_u
- (get_local $15)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $15)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $9)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $15
- (i32.shl
- (get_local $15)
- (i32.const 1)
+ (block (result i32)
+ (set_local $23
+ (get_local $5)
+ )
+ (set_local $21
+ (get_local $1)
+ )
+ (i32.const 145)
)
)
- (set_local $1
- (get_local $10)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $23
- (get_local $5)
- )
- (set_local $21
- (get_local $1)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 145)
)
(if
@@ -2679,7 +2678,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 148)
)
(if
@@ -2695,7 +2694,7 @@
)
)
)
- (tee_local $10
+ (tee_local $9
(i32.load
(i32.const 192)
)
@@ -2703,7 +2702,7 @@
)
(i32.ge_u
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
(block
@@ -2791,7 +2790,7 @@
(i32.const 184)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(set_local $14
@@ -2804,7 +2803,7 @@
(tee_local $3
(i32.sub
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(i32.const 15)
@@ -2815,7 +2814,7 @@
(tee_local $21
(i32.add
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2840,7 +2839,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -2895,7 +2894,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -2903,7 +2902,7 @@
(tee_local $3
(i32.sub
(get_local $14)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2916,7 +2915,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -2930,7 +2929,7 @@
(i32.store offset=4
(get_local $14)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3003,7 +3002,7 @@
)
(set_local $14
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 48)
)
)
@@ -3020,7 +3019,7 @@
)
(tee_local $12
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 47)
)
)
@@ -3034,7 +3033,7 @@
)
)
)
- (get_local $10)
+ (get_local $9)
)
(return
(i32.const 0)
@@ -3042,7 +3041,7 @@
)
(if
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 616)
)
@@ -3063,7 +3062,7 @@
)
(i32.gt_u
(get_local $16)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 0)
@@ -3082,7 +3081,7 @@
)
(i32.const 0)
(i32.eq
- (tee_local $8
+ (tee_local $10
(block $label$break$L257 (result i32)
(if
(i32.eqz
@@ -3096,7 +3095,7 @@
(block
(block $label$break$L259
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 200)
)
@@ -3115,7 +3114,7 @@
(get_local $16)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.gt_u
(i32.add
@@ -3129,7 +3128,7 @@
)
)
)
- (get_local $9)
+ (get_local $8)
)
(i32.const 0)
)
@@ -3150,7 +3149,7 @@
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
(br $label$break$L259)
@@ -3211,14 +3210,14 @@
(set_local $18
(get_local $16)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
)
)
)
)
- (set_local $8
+ (set_local $10
(i32.const 173)
)
)
@@ -3227,11 +3226,11 @@
(if
(if (result i32)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 173)
)
(i32.ne
- (tee_local $9
+ (tee_local $8
(call $_sbrk
(i32.const 0)
)
@@ -3255,7 +3254,7 @@
)
)
(tee_local $2
- (get_local $9)
+ (get_local $8)
)
)
(i32.add
@@ -3291,7 +3290,7 @@
(i32.and
(i32.gt_u
(get_local $0)
- (get_local $10)
+ (get_local $9)
)
(i32.lt_u
(get_local $0)
@@ -3327,11 +3326,11 @@
(get_local $0)
)
)
- (get_local $9)
+ (get_local $8)
)
(block
(set_local $20
- (get_local $9)
+ (get_local $8)
)
(set_local $22
(get_local $0)
@@ -3344,7 +3343,7 @@
(set_local $13
(get_local $7)
)
- (set_local $8
+ (set_local $10
(i32.const 183)
)
(get_local $0)
@@ -3359,7 +3358,7 @@
(block $label$break$L279
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 183)
)
(block
@@ -3396,7 +3395,7 @@
(get_local $12)
(get_local $18)
)
- (tee_local $9
+ (tee_local $8
(i32.load
(i32.const 656)
)
@@ -3404,7 +3403,7 @@
)
(i32.sub
(i32.const 0)
- (get_local $9)
+ (get_local $8)
)
)
)
@@ -3506,7 +3505,7 @@
)
)
(i32.add
- (get_local $10)
+ (get_local $9)
(i32.const 40)
)
)
@@ -3519,14 +3518,14 @@
(set_local $22
(get_local $13)
)
- (set_local $8
+ (set_local $10
(i32.const 193)
)
)
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 193)
)
(block
@@ -3600,7 +3599,7 @@
(set_local $49
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 203)
)
(br $do-out)
@@ -3639,7 +3638,7 @@
)
(i32.const 0)
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 203)
)
)
@@ -3765,7 +3764,7 @@
(set_local $40
(get_local $4)
)
- (set_local $8
+ (set_local $10
(i32.const 211)
)
(br $while-out42)
@@ -3785,7 +3784,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 211)
)
(set_local $28
@@ -3867,7 +3866,7 @@
(set_local $4
(i32.add
(get_local $12)
- (get_local $10)
+ (get_local $9)
)
)
(set_local $14
@@ -3876,13 +3875,13 @@
(get_local $3)
(get_local $12)
)
- (get_local $10)
+ (get_local $9)
)
)
(i32.store offset=4
(get_local $12)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -3983,7 +3982,7 @@
(block
(set_local $0
(if (result i32)
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4002,7 +4001,7 @@
(set_local $7
(get_local $2)
)
- (get_local $9)
+ (get_local $8)
)
(if (result i32)
(tee_local $16
@@ -4017,7 +4016,7 @@
)
(loop $while-in50
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4029,7 +4028,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4038,7 +4037,7 @@
)
)
(if
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $2
(i32.add
@@ -4050,7 +4049,7 @@
)
(block
(set_local $0
- (get_local $9)
+ (get_local $8)
)
(set_local $7
(get_local $2)
@@ -4091,7 +4090,7 @@
(if
(i32.ne
(i32.load
- (tee_local $9
+ (tee_local $8
(i32.add
(get_local $2)
(i32.const 12)
@@ -4116,7 +4115,7 @@
)
(block
(i32.store
- (get_local $9)
+ (get_local $8)
(get_local $21)
)
(i32.store
@@ -4497,7 +4496,7 @@
(block
(if
(i32.ge_u
- (tee_local $9
+ (tee_local $8
(i32.load
(tee_local $5
(i32.add
@@ -4516,7 +4515,7 @@
(get_local $5)
)
(set_local $34
- (get_local $9)
+ (get_local $8)
)
(br $do-once59)
)
@@ -4595,7 +4594,7 @@
(i32.const 14)
(i32.or
(i32.or
- (tee_local $9
+ (tee_local $8
(i32.and
(i32.shr_u
(i32.add
@@ -4632,7 +4631,7 @@
(tee_local $5
(i32.shl
(get_local $1)
- (get_local $9)
+ (get_local $8)
)
)
(i32.const 245760)
@@ -4757,76 +4756,75 @@
(get_local $2)
)
)
- (loop $while-in64
- (set_local $8
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $14)
+ )
+ (block
+ (set_local $35
+ (get_local $0)
+ )
+ (br $while-out63
+ (i32.const 281)
+ )
)
- (i32.const -8)
- )
- (get_local $14)
- )
- (block
- (set_local $35
- (get_local $0)
- )
- (br $while-out63
- (i32.const 281)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $2
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $2
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $16)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $16
(i32.shl
- (i32.shr_u
- (get_local $16)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $16)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $16
- (i32.shl
- (get_local $16)
- (i32.const 1)
+ (block (result i32)
+ (set_local $43
+ (get_local $2)
+ )
+ (set_local $51
+ (get_local $0)
+ )
+ (i32.const 278)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $43
- (get_local $2)
- )
- (set_local $51
- (get_local $0)
- )
- (i32.const 278)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 278)
)
(if
@@ -4858,7 +4856,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 281)
)
(if
@@ -4948,48 +4946,47 @@
)
)
)
- (loop $while-in66
- (set_local $0
- (if (result i32)
- (if (result i32)
- (i32.le_u
- (tee_local $4
- (i32.load
- (get_local $28)
- )
- )
- (get_local $13)
- )
- (i32.gt_u
- (tee_local $14
- (i32.add
- (get_local $4)
- (i32.load offset=4
- (get_local $28)
- )
- )
- )
- (get_local $13)
- )
- (i32.const 0)
- )
- (get_local $14)
- (block
- (set_local $28
- (i32.load offset=8
- (get_local $28)
- )
- )
- (br $while-in66)
- )
- )
- )
- )
(set_local $14
(i32.add
(tee_local $12
(i32.add
- (get_local $0)
+ (tee_local $0
+ (loop $while-in66 (result i32)
+ (if (result i32)
+ (if (result i32)
+ (i32.le_u
+ (tee_local $4
+ (i32.load
+ (get_local $28)
+ )
+ )
+ (get_local $13)
+ )
+ (i32.gt_u
+ (tee_local $14
+ (i32.add
+ (get_local $4)
+ (i32.load offset=4
+ (get_local $28)
+ )
+ )
+ )
+ (get_local $13)
+ )
+ (i32.const 0)
+ )
+ (get_local $14)
+ (block
+ (set_local $28
+ (i32.load offset=8
+ (get_local $28)
+ )
+ )
+ (br $while-in66)
+ )
+ )
+ )
+ )
(i32.const -47)
)
)
@@ -5484,76 +5481,75 @@
(get_local $3)
)
)
- (loop $while-in70
- (set_local $8
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $0)
+ (if
+ (i32.eq
+ (tee_local $10
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $0)
+ )
+ (i32.const -8)
+ )
+ (get_local $4)
+ )
+ (block
+ (set_local $37
+ (get_local $0)
+ )
+ (br $while-out69
+ (i32.const 307)
+ )
)
- (i32.const -8)
- )
- (get_local $4)
- )
- (block
- (set_local $37
- (get_local $0)
- )
- (br $while-out69
- (i32.const 307)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $3
- (i32.add
- (i32.add
- (get_local $0)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $3
+ (i32.add
+ (i32.add
+ (get_local $0)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $2)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $2
(i32.shl
- (i32.shr_u
- (get_local $2)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $2)
+ (i32.const 1)
)
)
+ (set_local $0
+ (get_local $1)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $2
- (i32.shl
- (get_local $2)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $3)
+ )
+ (set_local $52
+ (get_local $0)
+ )
+ (i32.const 304)
)
)
- (set_local $0
- (get_local $1)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $45
- (get_local $3)
- )
- (set_local $52
- (get_local $0)
- )
- (i32.const 304)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $8)
(i32.const 304)
)
(if
@@ -5585,7 +5581,7 @@
)
(if
(i32.eq
- (get_local $8)
+ (get_local $10)
(i32.const 307)
)
(if
@@ -5786,7 +5782,7 @@
(i32.const 188)
)
)
- (get_local $10)
+ (get_local $9)
)
(block
(i32.store
@@ -5794,7 +5790,7 @@
(tee_local $20
(i32.sub
(get_local $22)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5807,7 +5803,7 @@
(i32.const 200)
)
)
- (get_local $10)
+ (get_local $9)
)
)
)
@@ -5821,7 +5817,7 @@
(i32.store offset=4
(get_local $22)
(i32.or
- (get_local $10)
+ (get_local $9)
(i32.const 3)
)
)
@@ -7441,76 +7437,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $17
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $17
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $16
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $16
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $3)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $16)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $3)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $16)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8424,8 +8419,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index 4f75e6320..733670cd6 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -5317,8 +5317,8 @@
(get_local $13)
)
)
- (loop $while-in90
- (set_local $9
+ (set_local $9
+ (loop $while-in90 (result i32)
(block $while-out89 (result i32)
(if
(i32.le_u
diff --git a/test/emcc_hello_world.fromasm.clamp b/test/emcc_hello_world.fromasm.clamp
index fab96d967..932395919 100644
--- a/test/emcc_hello_world.fromasm.clamp
+++ b/test/emcc_hello_world.fromasm.clamp
@@ -5367,8 +5367,8 @@
(get_local $13)
)
)
- (loop $while-in90
- (set_local $9
+ (set_local $9
+ (loop $while-in90 (result i32)
(block $while-out89 (result i32)
(if
(i32.le_u
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 59147f9f6..a6a7e3b44 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -5242,8 +5242,8 @@
(get_local $13)
)
)
- (loop $while-in90
- (set_local $9
+ (set_local $9
+ (loop $while-in90 (result i32)
(block $while-out89 (result i32)
(if
(i32.le_u
diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm
index e30f3d298..30a06d35b 100644
--- a/test/memorygrowth.fromasm
+++ b/test/memorygrowth.fromasm
@@ -2641,76 +2641,75 @@
(get_local $12)
)
)
- (loop $while-in28
- (set_local $7
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $18)
+ )
+ (block
+ (set_local $17
+ (get_local $3)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $18)
- )
- (block
- (set_local $17
- (get_local $3)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $12
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $12
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $9)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $9
(i32.shl
- (i32.shr_u
- (get_local $9)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $9)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $9
- (i32.shl
- (get_local $9)
- (i32.const 1)
+ (block (result i32)
+ (set_local $21
+ (get_local $12)
+ )
+ (set_local $15
+ (get_local $3)
+ )
+ (i32.const 145)
)
)
- (set_local $3
- (get_local $1)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $21
- (get_local $12)
- )
- (set_local $15
- (get_local $3)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 145)
)
(if
@@ -4803,76 +4802,75 @@
(get_local $0)
)
)
- (loop $while-in64
- (set_local $7
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $15)
+ )
+ (block
+ (set_local $38
+ (get_local $3)
+ )
+ (br $while-out63
+ (i32.const 279)
+ )
)
- (i32.const -8)
- )
- (get_local $15)
- )
- (block
- (set_local $38
- (get_local $3)
- )
- (br $while-out63
- (i32.const 279)
)
- )
- )
- (if (result i32)
- (tee_local $4
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $4
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $5)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $5
(i32.shl
- (i32.shr_u
- (get_local $5)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $5)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $4)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $5
- (i32.shl
- (get_local $5)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $0)
+ )
+ (set_local $53
+ (get_local $3)
+ )
+ (i32.const 276)
)
)
- (set_local $3
- (get_local $4)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $45
- (get_local $0)
- )
- (set_local $53
- (get_local $3)
- )
- (i32.const 276)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 276)
)
(if
@@ -5511,76 +5509,75 @@
(get_local $0)
)
)
- (loop $while-in70
- (set_local $7
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $4)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $4)
+ )
+ (i32.const -8)
+ )
+ (get_local $2)
+ )
+ (block
+ (set_local $31
+ (get_local $4)
+ )
+ (br $while-out69
+ (i32.const 305)
+ )
)
- (i32.const -8)
- )
- (get_local $2)
- )
- (block
- (set_local $31
- (get_local $4)
- )
- (br $while-out69
- (i32.const 305)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $4)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $4)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $1)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $1
(i32.shl
- (i32.shr_u
- (get_local $1)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $1)
+ (i32.const 1)
)
)
+ (set_local $4
+ (get_local $3)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $1
- (i32.shl
- (get_local $1)
- (i32.const 1)
+ (block (result i32)
+ (set_local $47
+ (get_local $0)
+ )
+ (set_local $54
+ (get_local $4)
+ )
+ (i32.const 302)
)
)
- (set_local $4
- (get_local $3)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $47
- (get_local $0)
- )
- (set_local $54
- (get_local $4)
- )
- (i32.const 302)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 302)
)
(if
@@ -7484,76 +7481,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $16
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $16
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $11
- (i32.load
- (tee_local $7
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $11
+ (i32.load
+ (tee_local $7
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $11)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $7)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $11)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $7)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8365,8 +8361,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/memorygrowth.fromasm.clamp b/test/memorygrowth.fromasm.clamp
index e30f3d298..30a06d35b 100644
--- a/test/memorygrowth.fromasm.clamp
+++ b/test/memorygrowth.fromasm.clamp
@@ -2641,76 +2641,75 @@
(get_local $12)
)
)
- (loop $while-in28
- (set_local $7
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $18)
+ )
+ (block
+ (set_local $17
+ (get_local $3)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $18)
- )
- (block
- (set_local $17
- (get_local $3)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $12
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $12
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $9)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $9
(i32.shl
- (i32.shr_u
- (get_local $9)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $9)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $9
- (i32.shl
- (get_local $9)
- (i32.const 1)
+ (block (result i32)
+ (set_local $21
+ (get_local $12)
+ )
+ (set_local $15
+ (get_local $3)
+ )
+ (i32.const 145)
)
)
- (set_local $3
- (get_local $1)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $21
- (get_local $12)
- )
- (set_local $15
- (get_local $3)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 145)
)
(if
@@ -4803,76 +4802,75 @@
(get_local $0)
)
)
- (loop $while-in64
- (set_local $7
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $15)
+ )
+ (block
+ (set_local $38
+ (get_local $3)
+ )
+ (br $while-out63
+ (i32.const 279)
+ )
)
- (i32.const -8)
- )
- (get_local $15)
- )
- (block
- (set_local $38
- (get_local $3)
- )
- (br $while-out63
- (i32.const 279)
)
- )
- )
- (if (result i32)
- (tee_local $4
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $4
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $5)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $5
(i32.shl
- (i32.shr_u
- (get_local $5)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $5)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $4)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $5
- (i32.shl
- (get_local $5)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $0)
+ )
+ (set_local $53
+ (get_local $3)
+ )
+ (i32.const 276)
)
)
- (set_local $3
- (get_local $4)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $45
- (get_local $0)
- )
- (set_local $53
- (get_local $3)
- )
- (i32.const 276)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 276)
)
(if
@@ -5511,76 +5509,75 @@
(get_local $0)
)
)
- (loop $while-in70
- (set_local $7
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $4)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $4)
+ )
+ (i32.const -8)
+ )
+ (get_local $2)
+ )
+ (block
+ (set_local $31
+ (get_local $4)
+ )
+ (br $while-out69
+ (i32.const 305)
+ )
)
- (i32.const -8)
- )
- (get_local $2)
- )
- (block
- (set_local $31
- (get_local $4)
- )
- (br $while-out69
- (i32.const 305)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $4)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $4)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $1)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $1
(i32.shl
- (i32.shr_u
- (get_local $1)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $1)
+ (i32.const 1)
)
)
+ (set_local $4
+ (get_local $3)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $1
- (i32.shl
- (get_local $1)
- (i32.const 1)
+ (block (result i32)
+ (set_local $47
+ (get_local $0)
+ )
+ (set_local $54
+ (get_local $4)
+ )
+ (i32.const 302)
)
)
- (set_local $4
- (get_local $3)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $47
- (get_local $0)
- )
- (set_local $54
- (get_local $4)
- )
- (i32.const 302)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 302)
)
(if
@@ -7484,76 +7481,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $16
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $16
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $11
- (i32.load
- (tee_local $7
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $11
+ (i32.load
+ (tee_local $7
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $11)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $7)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $11)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $7)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8365,8 +8361,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise
index 5c4124ac1..0bb93aa16 100644
--- a/test/memorygrowth.fromasm.imprecise
+++ b/test/memorygrowth.fromasm.imprecise
@@ -2639,76 +2639,75 @@
(get_local $12)
)
)
- (loop $while-in28
- (set_local $7
- (block $while-out27 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in28 (result i32)
+ (block $while-out27 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $18)
+ )
+ (block
+ (set_local $17
+ (get_local $3)
+ )
+ (br $while-out27
+ (i32.const 148)
+ )
)
- (i32.const -8)
- )
- (get_local $18)
- )
- (block
- (set_local $17
- (get_local $3)
- )
- (br $while-out27
- (i32.const 148)
)
- )
- )
- (if (result i32)
- (tee_local $1
- (i32.load
- (tee_local $12
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $1
+ (i32.load
+ (tee_local $12
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $9)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $9
(i32.shl
- (i32.shr_u
- (get_local $9)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $9)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $1)
+ )
+ (br $while-in28)
)
- )
- )
- (block
- (set_local $9
- (i32.shl
- (get_local $9)
- (i32.const 1)
+ (block (result i32)
+ (set_local $21
+ (get_local $12)
+ )
+ (set_local $15
+ (get_local $3)
+ )
+ (i32.const 145)
)
)
- (set_local $3
- (get_local $1)
- )
- (br $while-in28)
- )
- (block (result i32)
- (set_local $21
- (get_local $12)
- )
- (set_local $15
- (get_local $3)
- )
- (i32.const 145)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 145)
)
(if
@@ -4801,76 +4800,75 @@
(get_local $0)
)
)
- (loop $while-in64
- (set_local $7
- (block $while-out63 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $3)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in64 (result i32)
+ (block $while-out63 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $3)
+ )
+ (i32.const -8)
+ )
+ (get_local $15)
+ )
+ (block
+ (set_local $38
+ (get_local $3)
+ )
+ (br $while-out63
+ (i32.const 279)
+ )
)
- (i32.const -8)
- )
- (get_local $15)
- )
- (block
- (set_local $38
- (get_local $3)
- )
- (br $while-out63
- (i32.const 279)
)
- )
- )
- (if (result i32)
- (tee_local $4
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $3)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $4
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $3)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $5)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $5
(i32.shl
- (i32.shr_u
- (get_local $5)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $5)
+ (i32.const 1)
)
)
+ (set_local $3
+ (get_local $4)
+ )
+ (br $while-in64)
)
- )
- )
- (block
- (set_local $5
- (i32.shl
- (get_local $5)
- (i32.const 1)
+ (block (result i32)
+ (set_local $45
+ (get_local $0)
+ )
+ (set_local $53
+ (get_local $3)
+ )
+ (i32.const 276)
)
)
- (set_local $3
- (get_local $4)
- )
- (br $while-in64)
- )
- (block (result i32)
- (set_local $45
- (get_local $0)
- )
- (set_local $53
- (get_local $3)
- )
- (i32.const 276)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 276)
)
(if
@@ -5509,76 +5507,75 @@
(get_local $0)
)
)
- (loop $while-in70
- (set_local $7
- (block $while-out69 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $4)
+ (if
+ (i32.eq
+ (tee_local $7
+ (loop $while-in70 (result i32)
+ (block $while-out69 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $4)
+ )
+ (i32.const -8)
+ )
+ (get_local $2)
+ )
+ (block
+ (set_local $31
+ (get_local $4)
+ )
+ (br $while-out69
+ (i32.const 305)
+ )
)
- (i32.const -8)
- )
- (get_local $2)
- )
- (block
- (set_local $31
- (get_local $4)
- )
- (br $while-out69
- (i32.const 305)
)
- )
- )
- (if (result i32)
- (tee_local $3
- (i32.load
- (tee_local $0
- (i32.add
- (i32.add
- (get_local $4)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $3
+ (i32.load
+ (tee_local $0
+ (i32.add
+ (i32.add
+ (get_local $4)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $1)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $1
(i32.shl
- (i32.shr_u
- (get_local $1)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $1)
+ (i32.const 1)
)
)
+ (set_local $4
+ (get_local $3)
+ )
+ (br $while-in70)
)
- )
- )
- (block
- (set_local $1
- (i32.shl
- (get_local $1)
- (i32.const 1)
+ (block (result i32)
+ (set_local $47
+ (get_local $0)
+ )
+ (set_local $54
+ (get_local $4)
+ )
+ (i32.const 302)
)
)
- (set_local $4
- (get_local $3)
- )
- (br $while-in70)
- )
- (block (result i32)
- (set_local $47
- (get_local $0)
- )
- (set_local $54
- (get_local $4)
- )
- (i32.const 302)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $7)
(i32.const 302)
)
(if
@@ -7482,76 +7479,75 @@
(get_local $5)
)
)
- (loop $while-in15
- (set_local $0
- (block $while-out14 (result i32)
- (if
- (i32.eq
- (i32.and
- (i32.load offset=4
- (get_local $1)
+ (if
+ (i32.eq
+ (tee_local $0
+ (loop $while-in15 (result i32)
+ (block $while-out14 (result i32)
+ (if
+ (i32.eq
+ (i32.and
+ (i32.load offset=4
+ (get_local $1)
+ )
+ (i32.const -8)
+ )
+ (get_local $0)
+ )
+ (block
+ (set_local $16
+ (get_local $1)
+ )
+ (br $while-out14
+ (i32.const 130)
+ )
)
- (i32.const -8)
- )
- (get_local $0)
- )
- (block
- (set_local $16
- (get_local $1)
- )
- (br $while-out14
- (i32.const 130)
)
- )
- )
- (if (result i32)
- (tee_local $11
- (i32.load
- (tee_local $7
- (i32.add
- (i32.add
- (get_local $1)
- (i32.const 16)
+ (if (result i32)
+ (tee_local $11
+ (i32.load
+ (tee_local $7
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (i32.const 16)
+ )
+ (i32.shl
+ (i32.shr_u
+ (get_local $13)
+ (i32.const 31)
+ )
+ (i32.const 2)
+ )
+ )
)
+ )
+ )
+ (block
+ (set_local $13
(i32.shl
- (i32.shr_u
- (get_local $13)
- (i32.const 31)
- )
- (i32.const 2)
+ (get_local $13)
+ (i32.const 1)
)
)
+ (set_local $1
+ (get_local $11)
+ )
+ (br $while-in15)
)
- )
- )
- (block
- (set_local $13
- (i32.shl
- (get_local $13)
- (i32.const 1)
+ (block (result i32)
+ (set_local $18
+ (get_local $7)
+ )
+ (set_local $19
+ (get_local $1)
+ )
+ (i32.const 127)
)
)
- (set_local $1
- (get_local $11)
- )
- (br $while-in15)
- )
- (block (result i32)
- (set_local $18
- (get_local $7)
- )
- (set_local $19
- (get_local $1)
- )
- (i32.const 127)
)
)
)
- )
- )
- (if
- (i32.eq
- (get_local $0)
(i32.const 127)
)
(if
@@ -8363,8 +8359,8 @@
(set_local $2
(get_local $1)
)
- (loop $while-in1
- (set_local $0
+ (set_local $0
+ (loop $while-in1 (result i32)
(if (result i32)
(i32.and
(i32.xor
diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt
index ac66234a6..7f83b348b 100644
--- a/test/passes/inlining-optimizing_optimize-level=3.txt
+++ b/test/passes/inlining-optimizing_optimize-level=3.txt
@@ -5416,8 +5416,8 @@
(get_local $13)
)
)
- (loop $while-in90
- (set_local $9
+ (set_local $9
+ (loop $while-in90 (result i32)
(block $while-out89 (result i32)
(if
(i32.le_u
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index fb261325c..21a8ab403 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -753,8 +753,9 @@
)
)
(func $no-out-of-label (; 13 ;) (type $8) (param $x i32) (param $y i32)
- (loop $moar
- (set_local $x
+ (nop)
+ (set_local $x
+ (loop $moar (result i32)
(block $block (result i32)
(br_if $moar
(get_local $x)
@@ -763,9 +764,6 @@
)
)
)
- (drop
- (get_local $x)
- )
(block $moar18
(set_local $y
(block $block19 (result i32)
@@ -782,8 +780,9 @@
)
(func $freetype-cd (; 14 ;) (type $5) (param $a i32) (result i32)
(local $e i32)
- (loop $while-in$1
- (set_local $a
+ (nop)
+ (tee_local $a
+ (loop $while-in$1 (result i32)
(block $while-out$0 (result i32)
(set_local $e
(get_local $a)
@@ -805,7 +804,6 @@
)
)
)
- (get_local $a)
)
(func $drop-if-value (; 15 ;) (type $9) (param $x i32) (param $y i32) (param $z i32) (result i32)
(local $temp i32)
@@ -1180,4 +1178,23 @@
)
)
)
+ (func $loop-value (; 12 ;) (type $5) (param $x i32) (result i32)
+ (loop $loopy
+ (unreachable)
+ )
+ (nop)
+ (loop $loopy9 (result i32)
+ (i32.const 1)
+ )
+ )
+ (func $loop-loop-loopy-value (; 13 ;) (type $5) (param $x i32) (result i32)
+ (nop)
+ (loop $loopy1 (result i32)
+ (loop $loopy2 (result i32)
+ (loop $loopy3 (result i32)
+ (i32.const 1)
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast
index df8e8b7dc..28f584f83 100644
--- a/test/passes/simplify-locals.wast
+++ b/test/passes/simplify-locals.wast
@@ -1078,4 +1078,23 @@
)
)
)
+ (func $loop-value (param $x i32) (result i32)
+ (loop $loopy
+ (set_local $x (unreachable))
+ )
+ (loop $loopy
+ (set_local $x (i32.const 1))
+ )
+ (get_local $x)
+ )
+ (func $loop-loop-loopy-value (param $x i32) (result i32)
+ (loop $loopy1
+ (loop $loopy2
+ (loop $loopy3
+ (set_local $x (i32.const 1))
+ )
+ )
+ )
+ (get_local $x)
+ )
)