mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 22:22:13 +00:00
Always try to eliminate branches if tree-shaking is enabled
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
(module
|
||||
(type $i (func (result i32)))
|
||||
(type $v (func))
|
||||
(global $ternary/a (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
@@ -7,54 +8,22 @@
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $v)
|
||||
(drop
|
||||
(if (result i32)
|
||||
(i32.const 0)
|
||||
(unreachable)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(drop
|
||||
(if (result i32)
|
||||
(i32.const 1)
|
||||
(i32.const 1)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(drop
|
||||
(if (result i32)
|
||||
(if (result i32)
|
||||
(i32.const 0)
|
||||
(unreachable)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $ternary/a
|
||||
(if (result i32)
|
||||
(i32.const 0)
|
||||
(unreachable)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $ternary/a
|
||||
(if (result i32)
|
||||
(i32.const 1)
|
||||
(i32.const 1)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $ternary/a
|
||||
(if (result i32)
|
||||
(if (result i32)
|
||||
(i32.const 0)
|
||||
(unreachable)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(unreachable)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user