diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/precompute-propagate_all-features.txt | 7 | ||||
-rw-r--r-- | test/passes/precompute-propagate_all-features.wast | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/test/passes/precompute-propagate_all-features.txt b/test/passes/precompute-propagate_all-features.txt index 09f2bc42d..6001d54ba 100644 --- a/test/passes/precompute-propagate_all-features.txt +++ b/test/passes/precompute-propagate_all-features.txt @@ -240,7 +240,12 @@ (func $multipass (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (nop) - (nop) + (if + (local.get $3) + (local.set $2 + (i32.const 0) + ) + ) (local.get $2) ) (func $through-fallthrough (param $x i32) (param $y i32) (result i32) diff --git a/test/passes/precompute-propagate_all-features.wast b/test/passes/precompute-propagate_all-features.wast index bad12eac8..59a06a860 100644 --- a/test/passes/precompute-propagate_all-features.wast +++ b/test/passes/precompute-propagate_all-features.wast @@ -141,7 +141,12 @@ (func $multipass (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (if - (local.get $3) + (local.get $3) ;; this will be precomputed to 0. after that, the if will be + ;; precomputed to not exist at all. removing the set in the + ;; if body then allows us to optimize the value of $3 in the + ;; if lower down, but we do not do an additional cycle of + ;; this pass automatically as such things are fairly rare, + ;; so that opportunity remains unoptimized in this test. (local.set $3 ;; this set is completely removed, allowing later opts (i32.const 24) ) |