mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 23:11:41 +00:00
Utilize Binaryen's -O4
When specifying -O3 or -Oz, asc now automatically increases the optimize level to 4, then including costly non-LLVM optimizations for blocky code, in turn achieving similar results as an LLVM-based generator.
This commit is contained in:
@ -13,7 +13,6 @@
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(block
|
||||
@ -52,26 +51,24 @@
|
||||
(grow_memory
|
||||
(select
|
||||
(get_local $2)
|
||||
(tee_local $4
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 65535)
|
||||
(tee_local $3
|
||||
(i32.shr_u
|
||||
(i32.and
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const -65536)
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const 16)
|
||||
(i32.const -65536)
|
||||
)
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $4)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -100,31 +97,32 @@
|
||||
)
|
||||
(func $std/new/AClass#constructor (; 1 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32)
|
||||
(local $2 i32)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(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 8)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(f32.store offset=4
|
||||
(get_local $2)
|
||||
(f32.const 2)
|
||||
)
|
||||
(tee_local $0
|
||||
(get_local $2)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(tee_local $2
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(i32.store
|
||||
(tee_local $0
|
||||
(call $~lib/allocator/arena/allocate_memory
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(f32.store offset=4
|
||||
(get_local $0)
|
||||
(f32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $2)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
|
Reference in New Issue
Block a user