summaryrefslogtreecommitdiff
path: root/test/passes/local-cse_ignore-implicit-traps.wast
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-03-08 13:54:04 -0800
committerGitHub <noreply@github.com>2017-03-08 13:54:04 -0800
commitd6508e1f9cef33c43016e4da7dd4b94392f280a9 (patch)
treed0a12833a0ea08ed7c317bec7b4ef6fa936a70f3 /test/passes/local-cse_ignore-implicit-traps.wast
parent71804e2bfd1ba49b7dd4ce82b6ad26ba13f1bca8 (diff)
downloadbinaryen-d6508e1f9cef33c43016e4da7dd4b94392f280a9.tar.gz
binaryen-d6508e1f9cef33c43016e4da7dd4b94392f280a9.tar.bz2
binaryen-d6508e1f9cef33c43016e4da7dd4b94392f280a9.zip
Local CSE (#930)
Simple local common subexpression elimination. Useful mostly to reduce code size (as VMs do GVN etc.). Enabled by default in -Oz.
Diffstat (limited to 'test/passes/local-cse_ignore-implicit-traps.wast')
-rw-r--r--test/passes/local-cse_ignore-implicit-traps.wast20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/passes/local-cse_ignore-implicit-traps.wast b/test/passes/local-cse_ignore-implicit-traps.wast
new file mode 100644
index 000000000..0f22084c6
--- /dev/null
+++ b/test/passes/local-cse_ignore-implicit-traps.wast
@@ -0,0 +1,20 @@
+(module
+ (memory 100 100)
+ (func $loads
+ (drop
+ (i32.load (i32.const 10))
+ )
+ (drop
+ (i32.load (i32.const 10))
+ )
+ (drop
+ (i32.load offset=5 (i32.const 10))
+ )
+ (drop
+ (i32.load (i32.const 11))
+ )
+ (drop
+ (i32.load (i32.const 10))
+ )
+ )
+)