diff options
author | Max Graey <maxgraey@gmail.com> | 2020-10-26 22:52:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 13:52:32 -0700 |
commit | 514a6c5eb339b67db852643405428f3add7d0e39 (patch) | |
tree | 128f0ece583b4397f5a23a751b210ac49a31ddaf /test/passes/optimize-instructions_all-features.wast | |
parent | c8eeeeaed96d7753efe1b597c1b6b68098d82c79 (diff) | |
download | binaryen-514a6c5eb339b67db852643405428f3add7d0e39.tar.gz binaryen-514a6c5eb339b67db852643405428f3add7d0e39.tar.bz2 binaryen-514a6c5eb339b67db852643405428f3add7d0e39.zip |
Drop RHS of shift if effective shift is zero (#3209)
Diffstat (limited to 'test/passes/optimize-instructions_all-features.wast')
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index ad422bd98..c3a6aaf59 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -5458,15 +5458,31 @@ (i64.const 63) ) )) - - ;; skip - (drop (i32.shl + ;; i32(x) >> (y & 32) -> x + (drop (i32.shr_u (local.get $x) (i32.and (local.get $y) (i32.const 32) ) )) + ;; i64(x) >> (y & 64) -> x + (drop (i64.shr_u + (local.get $z) + (i64.and + (local.get $w) + (i64.const 128) + ) + )) + + ;; skip + (drop (i64.shl + (local.get $z) + (i64.and + (local.get $w) + (i64.const 32) + ) + )) ;; skip (drop (i64.shr_u (local.get $z) |