diff options
author | Alon Zakai <azakai@google.com> | 2024-02-12 13:29:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 13:29:27 -0800 |
commit | 1948008a8c7ceca1ca278e76bdca72eebba0dae7 (patch) | |
tree | 9b48a403d8279d70db0ac932b45e03cd2fdc1f2d /test/passes/Oz_fuzz-exec_all-features.txt | |
parent | 34d35ae7c0a8e42f94fd02b4b1aa64aec3621a05 (diff) | |
download | binaryen-1948008a8c7ceca1ca278e76bdca72eebba0dae7.tar.gz binaryen-1948008a8c7ceca1ca278e76bdca72eebba0dae7.tar.bz2 binaryen-1948008a8c7ceca1ca278e76bdca72eebba0dae7.zip |
Precompute: Optimize array.len (#6299)
Arrays have immutable length, so we can optimize them like immutable fields.
Diffstat (limited to 'test/passes/Oz_fuzz-exec_all-features.txt')
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.txt | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt index 2f1428160..20cbca924 100644 --- a/test/passes/Oz_fuzz-exec_all-features.txt +++ b/test/passes/Oz_fuzz-exec_all-features.txt @@ -100,17 +100,16 @@ ) (func $arrays (type $void_func) (; has Stack IR ;) (local $0 (ref $bytes)) - (call $log - (array.len - (local.tee $0 - (array.new $bytes - (i32.const 42) - (i32.const 50) - ) - ) + (local.set $0 + (array.new $bytes + (i32.const 42) + (i32.const 50) ) ) (call $log + (i32.const 50) + ) + (call $log (array.get_u $bytes (local.get $0) (i32.const 10) @@ -271,17 +270,16 @@ ) (func $array.new_fixed (type $void_func) (; has Stack IR ;) (local $0 (ref $bytes)) - (call $log - (array.len - (local.tee $0 - (array.new_fixed $bytes 2 - (i32.const 42) - (i32.const 50) - ) - ) + (local.set $0 + (array.new_fixed $bytes 2 + (i32.const 42) + (i32.const 50) ) ) (call $log + (i32.const 2) + ) + (call $log (array.get_u $bytes (local.get $0) (i32.const 0) |