diff options
author | Alon Zakai <azakai@google.com> | 2019-03-06 14:12:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2019-03-06 16:34:34 -0800 |
commit | 83aa0dc2daf327ed264cc22e51af1a866787a764 (patch) | |
tree | 70660819a1cd694c9776b0eb93db7c162eab274f /test/passes/flatten_local-cse_Os.txt | |
parent | 22fe3269f79c38c7954967ec303642b5168844c3 (diff) | |
download | binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.tar.gz binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.tar.bz2 binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.zip |
Optimize added constants with propagation only if we see we will remove all uses of the original add, as otherwise we may just be adding work (both an offset, and an add). Refactor local-utils.h, and make UnneededSetRemover also check for side effects, so it cleanly removes all traces of unneeded sets.
Diffstat (limited to 'test/passes/flatten_local-cse_Os.txt')
-rw-r--r-- | test/passes/flatten_local-cse_Os.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/passes/flatten_local-cse_Os.txt b/test/passes/flatten_local-cse_Os.txt index ec612f52f..cee61f4ba 100644 --- a/test/passes/flatten_local-cse_Os.txt +++ b/test/passes/flatten_local-cse_Os.txt @@ -2,8 +2,9 @@ (type $0 (func (param i32 i32) (result i32))) (export "div16_internal" (func $0)) (func $0 (; 0 ;) (; has Stack IR ;) (type $0) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (i32.add - (local.tee $0 + (local.tee $2 (i32.xor (i32.shr_s (i32.shl @@ -21,7 +22,7 @@ ) ) ) - (local.get $0) + (local.get $2) ) ) ) |