mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 06:51:34 +00:00
Let the optimizer decide what it takes to become a select
This commit is contained in:
@ -210,7 +210,11 @@
|
||||
)
|
||||
(if
|
||||
(i32.and
|
||||
(select
|
||||
(if (result i32)
|
||||
(i32.ge_u
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(i32.const 3)
|
||||
@ -219,10 +223,6 @@
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
(i32.ge_u
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
|
@ -236,7 +236,13 @@
|
||||
)
|
||||
(if
|
||||
(i32.and
|
||||
(select
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.lt_u
|
||||
(get_local $8)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(i32.gt_u
|
||||
(get_local $8)
|
||||
(i32.const 3)
|
||||
@ -245,12 +251,6 @@
|
||||
(get_local $8)
|
||||
(i32.const 2)
|
||||
)
|
||||
(i32.eqz
|
||||
(i32.lt_u
|
||||
(get_local $8)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
|
@ -53,12 +53,12 @@
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(tee_local $0
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -70,13 +70,13 @@
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(tee_local $1
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
)
|
||||
)
|
||||
(f64.const 0)
|
||||
@ -86,12 +86,12 @@
|
||||
)
|
||||
)
|
||||
(set_global $logical/i
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -104,12 +104,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/i
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 0)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -122,12 +122,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/I
|
||||
(select
|
||||
(i64.const 1)
|
||||
(i64.const 2)
|
||||
(if (result i64)
|
||||
(i64.eqz
|
||||
(i64.const 1)
|
||||
)
|
||||
(i64.const 1)
|
||||
(i64.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -140,12 +140,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/I
|
||||
(select
|
||||
(i64.const 1)
|
||||
(i64.const 0)
|
||||
(if (result i64)
|
||||
(i64.eqz
|
||||
(i64.const 0)
|
||||
)
|
||||
(i64.const 1)
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -158,13 +158,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/f
|
||||
(select
|
||||
(f32.const 1)
|
||||
(f32.const 2)
|
||||
(if (result f32)
|
||||
(f32.eq
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
)
|
||||
(f32.const 1)
|
||||
(f32.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -177,13 +177,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/f
|
||||
(select
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
(if (result f32)
|
||||
(f32.eq
|
||||
(f32.const 0)
|
||||
(f32.const 0)
|
||||
)
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -196,13 +196,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/F
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -215,13 +215,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/F
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 0)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
|
@ -18,13 +18,13 @@
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $3)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $2)
|
||||
(get_local $2)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
|
@ -26,15 +26,15 @@
|
||||
(block $break|0
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $4)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
|
@ -65,13 +65,13 @@
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $3)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $2)
|
||||
(get_local $2)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
|
@ -86,13 +86,13 @@
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $3)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $2)
|
||||
(get_local $2)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
|
@ -134,15 +134,15 @@
|
||||
(block $break|0
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $4)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
@ -4271,12 +4271,12 @@
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(tee_local $0
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -4288,13 +4288,13 @@
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(tee_local $3
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
)
|
||||
)
|
||||
(f64.const 0)
|
||||
@ -4304,12 +4304,12 @@
|
||||
)
|
||||
)
|
||||
(set_global $logical/i
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4322,12 +4322,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/i
|
||||
(select
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(i32.const 0)
|
||||
)
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4340,12 +4340,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/I
|
||||
(select
|
||||
(i64.const 1)
|
||||
(i64.const 2)
|
||||
(if (result i64)
|
||||
(i64.eqz
|
||||
(i64.const 1)
|
||||
)
|
||||
(i64.const 1)
|
||||
(i64.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4358,12 +4358,12 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/I
|
||||
(select
|
||||
(i64.const 1)
|
||||
(i64.const 0)
|
||||
(if (result i64)
|
||||
(i64.eqz
|
||||
(i64.const 0)
|
||||
)
|
||||
(i64.const 1)
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4376,13 +4376,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/f
|
||||
(select
|
||||
(f32.const 1)
|
||||
(f32.const 2)
|
||||
(if (result f32)
|
||||
(f32.eq
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
)
|
||||
(f32.const 1)
|
||||
(f32.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4395,13 +4395,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/f
|
||||
(select
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
(if (result f32)
|
||||
(f32.eq
|
||||
(f32.const 0)
|
||||
(f32.const 0)
|
||||
)
|
||||
(f32.const 1)
|
||||
(f32.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4414,13 +4414,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/F
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 2)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -4433,13 +4433,13 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $logical/F
|
||||
(select
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
(if (result f64)
|
||||
(f64.eq
|
||||
(f64.const 0)
|
||||
(f64.const 0)
|
||||
)
|
||||
(f64.const 1)
|
||||
(f64.const 0)
|
||||
)
|
||||
)
|
||||
(if
|
||||
|
@ -472,13 +472,13 @@
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $1)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $2)
|
||||
(get_local $2)
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
|
@ -527,15 +527,15 @@
|
||||
(block $break|0
|
||||
(loop $continue|0
|
||||
(if
|
||||
(select
|
||||
(if (result i32)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $2)
|
||||
(i32.rem_u
|
||||
(get_local $1)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.eqz
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(block
|
||||
|
Reference in New Issue
Block a user