1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-06-30 07:02:24 +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:
dcodeIO
2018-06-09 14:05:33 +02:00
parent e9094bbd6f
commit c6ec5e2832
46 changed files with 14240 additions and 16223 deletions

@ -26,18 +26,16 @@
(i32.const 1)
)
(func $start (; 4 ;) (type $v)
(set_global $~argc
(i32.const 1)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne
(call_indirect (type $ii)
(i32.const 1)
(get_global $function-expression/f1)
)
(i32.ne
(call_indirect (type $ii)
(i32.const 1)
(get_global $function-expression/f1)
)
(i32.const 1)
)
(block
(call $~lib/env/abort
@ -49,18 +47,16 @@
(unreachable)
)
)
(set_global $~argc
(i32.const 1)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne
(call_indirect (type $ii)
(i32.const 2)
(get_global $function-expression/f2)
)
(i32.ne
(call_indirect (type $ii)
(i32.const 2)
(get_global $function-expression/f2)
)
(i32.const 2)
)
(block
(call $~lib/env/abort
@ -78,17 +74,15 @@
(call_indirect (type $v)
(get_global $function-expression/f3)
)
(set_global $~argc
(i32.const 0)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 0)
)
(i32.ne
(call_indirect (type $i)
(get_global $function-expression/f4)
)
(i32.const 1)
(i32.ne
(call_indirect (type $i)
(get_global $function-expression/f4)
)
(i32.const 1)
)
(block
(call $~lib/env/abort