diff options
author | Max Graey <maxgraey@gmail.com> | 2021-10-05 19:06:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 16:06:15 +0000 |
commit | 653b9d028c12361d3e9e0c4008f8018990b765cb (patch) | |
tree | 04fd27a6cfffdbc702a77f62af9c9eef6c3e311f /test/binaryen.js | |
parent | 6feb8838887d21f2412176f7fdc1ab68b0e5c23d (diff) | |
download | binaryen-653b9d028c12361d3e9e0c4008f8018990b765cb.tar.gz binaryen-653b9d028c12361d3e9e0c4008f8018990b765cb.tar.bz2 binaryen-653b9d028c12361d3e9e0c4008f8018990b765cb.zip |
[OptimizeInstructions] Fold select into zero or single expression for some patterns (#4181)
i32(x) ? i32(x) : 0 ==> x
i32(x) ? 0 : i32(x) ==> {x, 0}
i64(x) == 0 ? 0 : i64(x) ==> x
i64(x) != 0 ? i64(x) : 0 ==> x
i64(x) == 0 ? i64(x) : 0 ==> {x, 0}
i64(x) != 0 ? 0 : i64(x) ==> {x, 0}
Diffstat (limited to 'test/binaryen.js')
-rw-r--r-- | test/binaryen.js/optimize-levels.js.txt | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/test/binaryen.js/optimize-levels.js.txt b/test/binaryen.js/optimize-levels.js.txt index b5005dd0e..e8d918a2f 100644 --- a/test/binaryen.js/optimize-levels.js.txt +++ b/test/binaryen.js/optimize-levels.js.txt @@ -37,11 +37,7 @@ shrinkLevel=1 (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (select - (local.get $0) - (i32.const 0) - (local.get $0) - ) + (local.get $0) ) ) @@ -52,11 +48,7 @@ shrinkLevel=0 (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (param $0 i32) (result i32) - (select - (local.get $0) - (i32.const 0) - (local.get $0) - ) + (local.get $0) ) ) @@ -67,11 +59,7 @@ shrinkLevel=1 (type $i (func (param i32) (result i32))) (export "test" (func $test)) (func $test (; has Stack IR ;) (param $0 i32) (result i32) - (select - (local.get $0) - (i32.const 0) - (local.get $0) - ) + (local.get $0) ) ) |