Always try to eliminate branches if tree-shaking is enabled

This commit is contained in:
dcodeIO
2018-04-24 23:11:11 +02:00
parent 97e7158fff
commit 391db28fe2
38 changed files with 782 additions and 789 deletions

View File

@@ -2601,14 +2601,14 @@
(local $2 i32)
(local $3 i32)
(local $4 f64)
(local $5 i32)
(local $5 f64)
(local $6 f64)
(local $7 f64)
(local $8 f64)
(local $8 i32)
(local $9 i32)
(set_local $9
(set_local $8
(i32.load offset=4
(tee_local $2
(tee_local $3
(get_local $1)
)
)
@@ -2616,23 +2616,23 @@
(loop $continue|0
(if
(i32.lt_s
(get_local $3)
(get_local $9)
(get_local $2)
(get_local $8)
)
(block
(set_local $4
(f64.load offset=48
(tee_local $2
(tee_local $3
(if (result i32)
(i32.lt_u
(tee_local $2
(get_local $3)
(tee_local $9
(get_local $2)
)
(i32.shr_u
(i32.load
(tee_local $5
(tee_local $3
(i32.load
(tee_local $5
(tee_local $3
(get_local $1)
)
)
@@ -2643,9 +2643,9 @@
)
(i32.load offset=8
(i32.add
(get_local $5)
(get_local $3)
(i32.shl
(get_local $2)
(get_local $9)
(i32.const 2)
)
)
@@ -2655,12 +2655,23 @@
)
)
)
(set_local $5
(f64.add
(get_local $5)
(f64.mul
(f64.load offset=24
(get_local $3)
)
(get_local $4)
)
)
)
(set_local $6
(f64.add
(get_local $6)
(f64.mul
(f64.load offset=24
(get_local $2)
(f64.load offset=32
(get_local $3)
)
(get_local $4)
)
@@ -2669,28 +2680,17 @@
(set_local $7
(f64.add
(get_local $7)
(f64.mul
(f64.load offset=32
(get_local $2)
)
(get_local $4)
)
)
)
(set_local $8
(f64.add
(get_local $8)
(f64.mul
(f64.load offset=40
(get_local $2)
(get_local $3)
)
(get_local $4)
)
)
)
(set_local $3
(set_local $2
(i32.add
(get_local $3)
(get_local $2)
(i32.const 1)
)
)
@@ -2698,39 +2698,17 @@
)
)
)
(i32.store
(if (result i32)
(get_local $0)
(get_local $0)
(block (result i32)
(i32.store
(tee_local $3
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)
(i32.const 0)
)
(tee_local $0
(get_local $3)
)
)
)
(get_local $1)
)
(f64.store offset=24
(tee_local $1
(tee_local $2
(if (result i32)
(i32.lt_u
(i32.const 0)
(i32.shr_u
(i32.load
(tee_local $1
(tee_local $2
(i32.load
(tee_local $1
(i32.load
(get_local $0)
)
(tee_local $2
(get_local $1)
)
)
)
@@ -2740,7 +2718,7 @@
)
(i32.load offset=8
(i32.add
(get_local $1)
(get_local $2)
(i32.const 0)
)
)
@@ -2749,13 +2727,22 @@
)
(f64.div
(f64.neg
(get_local $6)
(get_local $5)
)
(f64.const 39.47841760435743)
)
)
(f64.store offset=32
(get_local $1)
(get_local $2)
(f64.div
(f64.neg
(get_local $6)
)
(f64.const 39.47841760435743)
)
)
(f64.store offset=40
(get_local $2)
(f64.div
(f64.neg
(get_local $7)
@@ -2763,16 +2750,21 @@
(f64.const 39.47841760435743)
)
)
(f64.store offset=40
(get_local $1)
(f64.div
(f64.neg
(get_local $8)
(if (result i32)
(get_local $0)
(get_local $0)
(block (result i32)
(i32.store
(tee_local $2
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)
(get_local $1)
)
(f64.const 39.47841760435743)
(get_local $2)
)
)
(get_local $0)
)
(func $assembly/index/init (; 11 ;) (type $v)
(local $0 i32)
@@ -2933,7 +2925,7 @@
)
(loop $continue|0
(if
(i32.lt_s
(i32.lt_u
(get_local $6)
(get_local $14)
)
@@ -3011,7 +3003,7 @@
)
(loop $continue|1
(if
(i32.lt_s
(i32.lt_u
(get_local $3)
(get_local $14)
)
@@ -3267,7 +3259,7 @@
)
(loop $continue|0
(if
(i32.lt_s
(i32.lt_u
(get_local $3)
(get_local $5)
)
@@ -3368,7 +3360,7 @@
)
(loop $continue|1
(if
(i32.lt_s
(i32.lt_u
(get_local $0)
(get_local $5)
)