diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-12-21 13:19:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-21 13:19:18 -0800 |
commit | fdd4cb7b11d43c6ff200c9541f8567000a8d4bcd (patch) | |
tree | 36c6a991a1a6f0b288eec05bf9ec197ba6d7624d /test/example | |
parent | 0f41b0708384c1f5d85304d5ed94d9edd57d38c9 (diff) | |
download | binaryen-fdd4cb7b11d43c6ff200c9541f8567000a8d4bcd.tar.gz binaryen-fdd4cb7b11d43c6ff200c9541f8567000a8d4bcd.tar.bz2 binaryen-fdd4cb7b11d43c6ff200c9541f8567000a8d4bcd.zip |
LocalCSE: Consider pass options, both size and cost (#1840)
With this we can optimize redundant global accesses fairly well (at least locally; licm also works), see #1831
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/cpp-unit.cpp | 18 | ||||
-rw-r--r-- | test/example/cpp-unit.txt | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/example/cpp-unit.cpp b/test/example/cpp-unit.cpp new file mode 100644 index 000000000..f51ca72b6 --- /dev/null +++ b/test/example/cpp-unit.cpp @@ -0,0 +1,18 @@ +// test multiple uses of the threadPool + +#include <assert.h> + +#include <wasm.h> +#include <ir/cost.h> + +using namespace wasm; + +int main() +{ + // Some optimizations assume that the cost of a get is zero, e.g. local-cse. + GetLocal get; + assert(CostAnalyzer(&get).cost == 0); + + std::cout << "Success.\n"; + return 0; +} diff --git a/test/example/cpp-unit.txt b/test/example/cpp-unit.txt new file mode 100644 index 000000000..a9d787cc5 --- /dev/null +++ b/test/example/cpp-unit.txt @@ -0,0 +1 @@ +Success. |