mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-16 08:21:44 +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,14 +13,18 @@
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
@ -32,12 +36,8 @@
|
||||
)
|
||||
)
|
||||
(if
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(return
|
||||
(i32.or
|
||||
@ -70,20 +70,26 @@
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(tee_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
@ -102,14 +108,18 @@
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
@ -121,12 +131,8 @@
|
||||
)
|
||||
)
|
||||
(if
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(return
|
||||
(i32.or
|
||||
@ -162,20 +168,26 @@
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(tee_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
@ -194,14 +206,18 @@
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(if (result i32)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(get_local $1)
|
||||
(i32.const 0)
|
||||
(tee_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
@ -230,21 +246,6 @@
|
||||
)
|
||||
)
|
||||
(func $~lib/polyfills/bswap<u64> (; 6 ;) (type $II) (param $0 i64) (result i64)
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 2)
|
||||
(i32.const 2)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(i64.rotr
|
||||
(i64.or
|
||||
(i64.and
|
||||
@ -283,85 +284,51 @@
|
||||
)
|
||||
)
|
||||
(func $~lib/polyfills/bswap16<u32> (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 27)
|
||||
(i32.const 2)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(return
|
||||
(i32.or
|
||||
(i32.or
|
||||
(i32.or
|
||||
(i32.and
|
||||
(i32.shl
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 65280)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
(i32.and
|
||||
(i32.shl
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 65280)
|
||||
)
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const -65536)
|
||||
(i32.shr_u
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const -65536)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $~lib/polyfills/bswap16<i32> (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 27)
|
||||
(i32.const 2)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(return
|
||||
(i32.or
|
||||
(i32.or
|
||||
(i32.or
|
||||
(i32.and
|
||||
(i32.shl
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 65280)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_s
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
(i32.and
|
||||
(i32.shl
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 65280)
|
||||
)
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const -65536)
|
||||
(i32.shr_s
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const -65536)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $start (; 9 ;) (type $v)
|
||||
|
Reference in New Issue
Block a user