mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-25 04:31:43 +00:00
Suppress some unnecessary blocks and nops; Fix compilation of always 'break'ing 'do's
This commit is contained in:
@ -141,7 +141,6 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(nop)
|
||||
(block $break|0
|
||||
(loop $continue|0
|
||||
(if
|
||||
@ -2233,22 +2232,20 @@
|
||||
(if
|
||||
(get_local $2)
|
||||
(block
|
||||
(block
|
||||
(i32.store8
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(tee_local $2
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.store8
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(tee_local $2
|
||||
(i32.sub
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.load8_u
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(i32.load8_u
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -2261,6 +2258,7 @@
|
||||
)
|
||||
)
|
||||
(func $~lib/allocator/arena/free_memory (; 5 ;) (type $iv) (param $0 i32)
|
||||
(nop)
|
||||
)
|
||||
(func $~lib/set/Set<i32>#add (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
@ -2418,25 +2416,23 @@
|
||||
(get_local $3)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
(if
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
(if
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(return
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(return
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $2
|
||||
@ -2492,10 +2488,31 @@
|
||||
(get_local $3)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
(if
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(if
|
||||
(i32.eq
|
||||
(i32.load
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(if
|
||||
(i32.lt_u
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $3)
|
||||
)
|
||||
(call $~lib/memory/move_memory
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
@ -2505,62 +2522,39 @@
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(if
|
||||
(i32.lt_u
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $3)
|
||||
)
|
||||
(call $~lib/memory/move_memory
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.sub
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store offset=8
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load offset=8
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.sub
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(return
|
||||
)
|
||||
(i32.store offset=8
|
||||
(get_local $0)
|
||||
(i32.sub
|
||||
(i32.load offset=8
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(return
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $2
|
||||
|
Reference in New Issue
Block a user