summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/optimize-instructions.txt')
-rw-r--r--test/passes/optimize-instructions.txt124
1 files changed, 122 insertions, 2 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt
index 88709e2fe..d77a1e1c2 100644
--- a/test/passes/optimize-instructions.txt
+++ b/test/passes/optimize-instructions.txt
@@ -1032,9 +1032,9 @@
)
(drop
(i32.add
- (i32.mul
+ (i32.shl
(get_local $0)
- (i32.const 2)
+ (i32.const 1)
)
(i32.const 34)
)
@@ -2296,6 +2296,126 @@
)
)
)
+ (func $mul-power-2 (; 60 ;) (type $3) (param $x i32) (result i32)
+ (drop
+ (call $mul-power-2
+ (i32.shl
+ (get_local $x)
+ (i32.const 2)
+ )
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (i32.mul
+ (get_local $x)
+ (i32.const 5)
+ )
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (get_local $x)
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (i32.const 0)
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (i32.mul
+ (call $mul-power-2
+ (i32.const 123)
+ )
+ (i32.const 0)
+ )
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (i32.mul
+ (get_local $x)
+ (i32.const -1)
+ )
+ )
+ )
+ (drop
+ (call $mul-power-2
+ (i32.shl
+ (get_local $x)
+ (i32.const 31)
+ )
+ )
+ )
+ (unreachable)
+ )
+ (func $urem-power-2 (; 61 ;) (type $3) (param $x i32) (result i32)
+ (drop
+ (call $urem-power-2
+ (i32.and
+ (get_local $x)
+ (i32.const 3)
+ )
+ )
+ )
+ (drop
+ (call $urem-power-2
+ (i32.rem_u
+ (get_local $x)
+ (i32.const 5)
+ )
+ )
+ )
+ (drop
+ (call $urem-power-2
+ (i32.const 0)
+ )
+ )
+ (drop
+ (call $urem-power-2
+ (i32.rem_u
+ (get_local $x)
+ (i32.const 0)
+ )
+ )
+ )
+ (drop
+ (call $urem-power-2
+ (i32.rem_u
+ (get_local $x)
+ (i32.const -1)
+ )
+ )
+ )
+ (drop
+ (call $urem-power-2
+ (i32.and
+ (get_local $x)
+ (i32.const 2147483647)
+ )
+ )
+ )
+ (unreachable)
+ )
+ (func $orZero (; 62 ;) (type $3) (param $0 i32) (result i32)
+ (get_local $0)
+ )
+ (func $andZero (; 63 ;) (type $3) (param $0 i32) (result i32)
+ (drop
+ (i32.const 0)
+ )
+ (drop
+ (i32.and
+ (call $andZero
+ (i32.const 1234)
+ )
+ (i32.const 0)
+ )
+ )
+ (unreachable)
+ )
)
(module
(type $0 (func))