summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions_all-features.txt44
-rw-r--r--test/passes/optimize-instructions_all-features.wast48
2 files changed, 91 insertions, 1 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt
index 5bbaccfea..ee6b1162a 100644
--- a/test/passes/optimize-instructions_all-features.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -4319,6 +4319,50 @@
)
)
)
+ (drop
+ (i32.or
+ (local.get $x)
+ (i32.or
+ (local.tee $x
+ (i32.const 1)
+ )
+ (local.get $x)
+ )
+ )
+ )
+ (drop
+ (i32.or
+ (i32.or
+ (local.get $x)
+ (local.tee $x
+ (i32.const 1)
+ )
+ )
+ (local.get $x)
+ )
+ )
+ (drop
+ (i32.xor
+ (local.get $x)
+ (i32.xor
+ (local.tee $x
+ (i32.const 1)
+ )
+ (local.get $x)
+ )
+ )
+ )
+ (drop
+ (i32.xor
+ (i32.xor
+ (local.get $x)
+ (local.tee $x
+ (i32.const 1)
+ )
+ )
+ (local.get $x)
+ )
+ )
)
(func $optimize-bulk-memory-copy (param $dst i32) (param $src i32) (param $sz i32)
(memory.copy
diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast
index c8a48391c..71646de93 100644
--- a/test/passes/optimize-instructions_all-features.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -4805,7 +4805,53 @@
(local.get $x)
(local.get $y)
)
- ))
+ ))
+ ;; x | (y | x) where x and y cannot be reordered - skip
+ (drop
+ (i32.or
+ (local.get $x)
+ (i32.or
+ (local.tee $x
+ (i32.const 1)
+ )
+ (local.get $x)
+ )
+ )
+ )
+ (drop
+ (i32.or
+ (i32.or
+ (local.get $x)
+ (local.tee $x
+ (i32.const 1)
+ )
+ )
+ (local.get $x)
+ )
+ )
+ ;; x ^ (y ^ x) where x and y cannot be reordered - skip
+ (drop
+ (i32.xor
+ (local.get $x)
+ (i32.xor
+ (local.tee $x
+ (i32.const 1)
+ )
+ (local.get $x)
+ )
+ )
+ )
+ (drop
+ (i32.xor
+ (i32.xor
+ (local.get $x)
+ (local.tee $x
+ (i32.const 1)
+ )
+ )
+ (local.get $x)
+ )
+ )
)
(func $optimize-bulk-memory-copy (param $dst i32) (param $src i32) (param $sz i32)
(memory.copy ;; skip