summaryrefslogtreecommitdiff
path: root/test/llvm_autogenerated
diff options
context:
space:
mode:
Diffstat (limited to 'test/llvm_autogenerated')
-rw-r--r--test/llvm_autogenerated/call.s32
-rw-r--r--test/llvm_autogenerated/call.wast22
-rw-r--r--test/llvm_autogenerated/irreducible-cfg.s114
-rw-r--r--test/llvm_autogenerated/irreducible-cfg.wast126
-rw-r--r--test/llvm_autogenerated/load-store-i1.s20
-rw-r--r--test/llvm_autogenerated/load-store-i1.wast16
-rw-r--r--test/llvm_autogenerated/reg-stackify.s16
-rw-r--r--test/llvm_autogenerated/reg-stackify.wast20
8 files changed, 216 insertions, 150 deletions
diff --git a/test/llvm_autogenerated/call.s b/test/llvm_autogenerated/call.s
index b68b5c68b..0d3944836 100644
--- a/test/llvm_autogenerated/call.s
+++ b/test/llvm_autogenerated/call.s
@@ -92,14 +92,34 @@ call_indirect_i32:
.Lfunc_end8:
.size call_indirect_i32, .Lfunc_end8-call_indirect_i32
+ .globl call_indirect_arg
+ .type call_indirect_arg,@function
+call_indirect_arg:
+ .param i32, i32
+ call_indirect $1, $0
+ return
+ .endfunc
+.Lfunc_end9:
+ .size call_indirect_arg, .Lfunc_end9-call_indirect_arg
+
+ .globl call_indirect_arg_2
+ .type call_indirect_arg_2,@function
+call_indirect_arg_2:
+ .param i32, i32, i32
+ i32.call_indirect $drop=, $1, $2, $0
+ return
+ .endfunc
+.Lfunc_end10:
+ .size call_indirect_arg_2, .Lfunc_end10-call_indirect_arg_2
+
.globl tail_call_void_nullary
.type tail_call_void_nullary,@function
tail_call_void_nullary:
call void_nullary@FUNCTION
return
.endfunc
-.Lfunc_end9:
- .size tail_call_void_nullary, .Lfunc_end9-tail_call_void_nullary
+.Lfunc_end11:
+ .size tail_call_void_nullary, .Lfunc_end11-tail_call_void_nullary
.globl fastcc_tail_call_void_nullary
.type fastcc_tail_call_void_nullary,@function
@@ -107,8 +127,8 @@ fastcc_tail_call_void_nullary:
call void_nullary@FUNCTION
return
.endfunc
-.Lfunc_end10:
- .size fastcc_tail_call_void_nullary, .Lfunc_end10-fastcc_tail_call_void_nullary
+.Lfunc_end12:
+ .size fastcc_tail_call_void_nullary, .Lfunc_end12-fastcc_tail_call_void_nullary
.globl coldcc_tail_call_void_nullary
.type coldcc_tail_call_void_nullary,@function
@@ -116,8 +136,8 @@ coldcc_tail_call_void_nullary:
call void_nullary@FUNCTION
return
.endfunc
-.Lfunc_end11:
- .size coldcc_tail_call_void_nullary, .Lfunc_end11-coldcc_tail_call_void_nullary
+.Lfunc_end13:
+ .size coldcc_tail_call_void_nullary, .Lfunc_end13-coldcc_tail_call_void_nullary
.functype i32_nullary, i32
diff --git a/test/llvm_autogenerated/call.wast b/test/llvm_autogenerated/call.wast
index 724d79c5b..8a4dee01a 100644
--- a/test/llvm_autogenerated/call.wast
+++ b/test/llvm_autogenerated/call.wast
@@ -1,8 +1,9 @@
(module
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
- (type $FUNCSIG$ii (func (param i32) (result i32)))
+ (type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
+ (type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$j (func (result i64)))
(type $FUNCSIG$f (func (result f32)))
(type $FUNCSIG$d (func (result f64)))
@@ -25,6 +26,8 @@
(export "call_i32_binary" (func $call_i32_binary))
(export "call_indirect_void" (func $call_indirect_void))
(export "call_indirect_i32" (func $call_indirect_i32))
+ (export "call_indirect_arg" (func $call_indirect_arg))
+ (export "call_indirect_arg_2" (func $call_indirect_arg_2))
(export "tail_call_void_nullary" (func $tail_call_void_nullary))
(export "fastcc_tail_call_void_nullary" (func $fastcc_tail_call_void_nullary))
(export "coldcc_tail_call_void_nullary" (func $coldcc_tail_call_void_nullary))
@@ -80,6 +83,23 @@
)
)
)
+ (func $call_indirect_arg (param $0 i32) (param $1 i32)
+ (call_indirect $FUNCSIG$vi
+ (get_local $1)
+ (get_local $0)
+ )
+ (return)
+ )
+ (func $call_indirect_arg_2 (param $0 i32) (param $1 i32) (param $2 i32)
+ (drop
+ (call_indirect $FUNCSIG$iii
+ (get_local $1)
+ (get_local $2)
+ (get_local $0)
+ )
+ )
+ (return)
+ )
(func $tail_call_void_nullary
(call $void_nullary)
(return)
diff --git a/test/llvm_autogenerated/irreducible-cfg.s b/test/llvm_autogenerated/irreducible-cfg.s
index 9cecc7b3e..028f071ef 100644
--- a/test/llvm_autogenerated/irreducible-cfg.s
+++ b/test/llvm_autogenerated/irreducible-cfg.s
@@ -4,22 +4,21 @@
.type test0,@function
test0:
.param i32, i32, i32, i32
- .local f64, i32, i32
- i32.const $5=, 0
+ .local f64, i32
block
block
- i32.eqz $push18=, $2
- br_if 0, $pop18
+ br_if 0, $2
+ i32.const $2=, 0
+ i32.const $5=, 1
+ br 1
+.LBB0_3:
+ end_block
i32.const $push0=, 3
i32.shl $push1=, $3, $pop0
i32.add $push2=, $0, $pop1
f64.load $4=, 0($pop2):p2align=2
- i32.const $6=, 0
- br 1
-.LBB0_3:
- end_block
- i32.const $6=, 1
-.LBB0_4:
+ i32.const $5=, 0
+.LBB0_5:
end_block
loop
block
@@ -28,49 +27,49 @@ test0:
block
block
block
- br_table $6, 2, 0, 3, 1, 1
-.LBB0_5:
+ br_table $5, 2, 0, 3, 1, 1
+.LBB0_6:
end_block
- i32.ge_s $push3=, $5, $1
+ i32.ge_s $push3=, $2, $1
br_if 4, $pop3
- i32.const $6=, 3
+ i32.const $5=, 3
br 5
-.LBB0_7:
+.LBB0_8:
end_block
i32.const $push4=, 3
- i32.shl $push5=, $5, $pop4
+ i32.shl $push5=, $2, $pop4
i32.add $push17=, $0, $pop5
- tee_local $push16=, $2=, $pop17
- f64.load $push6=, 0($2):p2align=2
+ tee_local $push16=, $3=, $pop17
+ f64.load $push6=, 0($3):p2align=2
f64.const $push7=, 0x1.2666666666666p1
f64.mul $push15=, $pop6, $pop7
tee_local $push14=, $4=, $pop15
f64.store 0($pop16):p2align=2, $pop14
- i32.const $6=, 0
+ i32.const $5=, 0
br 4
-.LBB0_9:
+.LBB0_10:
end_block
i32.const $push10=, 3
- i32.shl $push11=, $5, $pop10
+ i32.shl $push11=, $2, $pop10
i32.add $push12=, $0, $pop11
f64.const $push8=, 0x1.4cccccccccccdp0
f64.add $push9=, $4, $pop8
f64.store 0($pop12):p2align=2, $pop9
i32.const $push13=, 1
- i32.add $5=, $5, $pop13
+ i32.add $2=, $2, $pop13
br 1
-.LBB0_10:
+.LBB0_11:
end_block
return
-.LBB0_11:
+.LBB0_12:
end_block
- i32.const $6=, 1
+ i32.const $5=, 1
br 1
-.LBB0_12:
+.LBB0_13:
end_block
- i32.const $6=, 2
+ i32.const $5=, 2
br 0
-.LBB0_13:
+.LBB0_14:
end_loop
.endfunc
.Lfunc_end0:
@@ -80,22 +79,21 @@ test0:
.type test1,@function
test1:
.param i32, i32, i32, i32
- .local f64, i32, i32
- i32.const $5=, 0
+ .local f64, i32
block
block
- i32.eqz $push23=, $2
- br_if 0, $pop23
+ br_if 0, $2
+ i32.const $3=, 0
+ i32.const $5=, 1
+ br 1
+.LBB1_3:
+ end_block
i32.const $push0=, 3
i32.shl $push1=, $3, $pop0
i32.add $push2=, $0, $pop1
f64.load $4=, 0($pop2):p2align=2
- i32.const $6=, 0
- br 1
-.LBB1_3:
- end_block
- i32.const $6=, 1
-.LBB1_4:
+ i32.const $5=, 0
+.LBB1_5:
end_block
loop
block
@@ -106,17 +104,17 @@ test1:
block
block
block
- br_table $6, 3, 0, 4, 1, 2, 2
-.LBB1_5:
+ br_table $5, 3, 0, 4, 1, 2, 2
+.LBB1_6:
end_block
- i32.ge_s $push3=, $5, $1
+ i32.ge_s $push3=, $3, $1
br_if 6, $pop3
- i32.const $6=, 3
+ i32.const $5=, 3
br 7
-.LBB1_7:
+.LBB1_8:
end_block
i32.const $push4=, 3
- i32.shl $push5=, $5, $pop4
+ i32.shl $push5=, $3, $pop4
i32.add $push18=, $0, $pop5
tee_local $push17=, $2=, $pop18
f64.load $push6=, 0($2):p2align=2
@@ -125,9 +123,9 @@ test1:
tee_local $push15=, $4=, $pop16
f64.store 0($pop17):p2align=2, $pop15
i32.const $2=, 0
- i32.const $6=, 4
+ i32.const $5=, 4
br 6
-.LBB1_9:
+.LBB1_10:
end_block
i32.const $push22=, 1
i32.add $push21=, $2, $pop22
@@ -135,35 +133,35 @@ test1:
i32.const $push19=, 256
i32.lt_s $push8=, $pop20, $pop19
br_if 3, $pop8
- i32.const $6=, 0
+ i32.const $5=, 0
br 5
-.LBB1_11:
+.LBB1_12:
end_block
i32.const $push11=, 3
- i32.shl $push12=, $5, $pop11
+ i32.shl $push12=, $3, $pop11
i32.add $push13=, $0, $pop12
f64.const $push9=, 0x1.4cccccccccccdp0
f64.add $push10=, $4, $pop9
f64.store 0($pop13):p2align=2, $pop10
i32.const $push14=, 1
- i32.add $5=, $5, $pop14
+ i32.add $3=, $3, $pop14
br 1
-.LBB1_12:
+.LBB1_13:
end_block
return
-.LBB1_13:
+.LBB1_14:
end_block
- i32.const $6=, 1
+ i32.const $5=, 1
br 2
-.LBB1_14:
+.LBB1_15:
end_block
- i32.const $6=, 4
+ i32.const $5=, 4
br 1
-.LBB1_15:
+.LBB1_16:
end_block
- i32.const $6=, 2
+ i32.const $5=, 2
br 0
-.LBB1_16:
+.LBB1_17:
end_loop
.endfunc
.Lfunc_end1:
diff --git a/test/llvm_autogenerated/irreducible-cfg.wast b/test/llvm_autogenerated/irreducible-cfg.wast
index 8712809cc..10b837232 100644
--- a/test/llvm_autogenerated/irreducible-cfg.wast
+++ b/test/llvm_autogenerated/irreducible-cfg.wast
@@ -7,35 +7,32 @@
(func $test0 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64)
(local $5 i32)
- (local $6 i32)
- (set_local $5
- (i32.const 0)
- )
(block $label$0
(block $label$1
(br_if $label$1
- (i32.eqz
- (get_local $2)
- )
+ (get_local $2)
)
- (set_local $4
- (f64.load align=4
- (i32.add
- (get_local $0)
- (i32.shl
- (get_local $3)
- (i32.const 3)
- )
- )
- )
- )
- (set_local $6
+ (set_local $2
(i32.const 0)
)
+ (set_local $5
+ (i32.const 1)
+ )
(br $label$0)
)
- (set_local $6
- (i32.const 1)
+ (set_local $4
+ (f64.load align=4
+ (i32.add
+ (get_local $0)
+ (i32.shl
+ (get_local $3)
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ (set_local $5
+ (i32.const 0)
)
)
(loop $label$2
@@ -46,26 +43,26 @@
(block $label$7
(block $label$8
(br_table $label$6 $label$8 $label$5 $label$7 $label$7
- (get_local $6)
+ (get_local $5)
)
)
(br_if $label$3
(i32.ge_s
- (get_local $5)
+ (get_local $2)
(get_local $1)
)
)
- (set_local $6
+ (set_local $5
(i32.const 3)
)
(br $label$2)
)
(f64.store align=4
- (tee_local $2
+ (tee_local $3
(i32.add
(get_local $0)
(i32.shl
- (get_local $5)
+ (get_local $2)
(i32.const 3)
)
)
@@ -73,13 +70,13 @@
(tee_local $4
(f64.mul
(f64.load align=4
- (get_local $2)
+ (get_local $3)
)
(f64.const 2.3)
)
)
)
- (set_local $6
+ (set_local $5
(i32.const 0)
)
(br $label$2)
@@ -88,7 +85,7 @@
(i32.add
(get_local $0)
(i32.shl
- (get_local $5)
+ (get_local $2)
(i32.const 3)
)
)
@@ -97,9 +94,9 @@
(f64.const 1.3)
)
)
- (set_local $5
+ (set_local $2
(i32.add
- (get_local $5)
+ (get_local $2)
(i32.const 1)
)
)
@@ -107,12 +104,12 @@
)
(return)
)
- (set_local $6
+ (set_local $5
(i32.const 1)
)
(br $label$2)
)
- (set_local $6
+ (set_local $5
(i32.const 2)
)
(br $label$2)
@@ -121,35 +118,32 @@
(func $test1 (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64)
(local $5 i32)
- (local $6 i32)
- (set_local $5
- (i32.const 0)
- )
(block $label$0
(block $label$1
(br_if $label$1
- (i32.eqz
- (get_local $2)
- )
- )
- (set_local $4
- (f64.load align=4
- (i32.add
- (get_local $0)
- (i32.shl
- (get_local $3)
- (i32.const 3)
- )
- )
- )
+ (get_local $2)
)
- (set_local $6
+ (set_local $3
(i32.const 0)
)
+ (set_local $5
+ (i32.const 1)
+ )
(br $label$0)
)
- (set_local $6
- (i32.const 1)
+ (set_local $4
+ (f64.load align=4
+ (i32.add
+ (get_local $0)
+ (i32.shl
+ (get_local $3)
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ (set_local $5
+ (i32.const 0)
)
)
(loop $label$2
@@ -162,16 +156,16 @@
(block $label$9
(block $label$10
(br_table $label$7 $label$10 $label$6 $label$9 $label$8 $label$8
- (get_local $6)
+ (get_local $5)
)
)
(br_if $label$3
(i32.ge_s
- (get_local $5)
+ (get_local $3)
(get_local $1)
)
)
- (set_local $6
+ (set_local $5
(i32.const 3)
)
(br $label$2)
@@ -181,7 +175,7 @@
(i32.add
(get_local $0)
(i32.shl
- (get_local $5)
+ (get_local $3)
(i32.const 3)
)
)
@@ -198,7 +192,7 @@
(set_local $2
(i32.const 0)
)
- (set_local $6
+ (set_local $5
(i32.const 4)
)
(br $label$2)
@@ -214,7 +208,7 @@
(i32.const 256)
)
)
- (set_local $6
+ (set_local $5
(i32.const 0)
)
(br $label$2)
@@ -223,7 +217,7 @@
(i32.add
(get_local $0)
(i32.shl
- (get_local $5)
+ (get_local $3)
(i32.const 3)
)
)
@@ -232,9 +226,9 @@
(f64.const 1.3)
)
)
- (set_local $5
+ (set_local $3
(i32.add
- (get_local $5)
+ (get_local $3)
(i32.const 1)
)
)
@@ -242,17 +236,17 @@
)
(return)
)
- (set_local $6
+ (set_local $5
(i32.const 1)
)
(br $label$2)
)
- (set_local $6
+ (set_local $5
(i32.const 4)
)
(br $label$2)
)
- (set_local $6
+ (set_local $5
(i32.const 2)
)
(br $label$2)
diff --git a/test/llvm_autogenerated/load-store-i1.s b/test/llvm_autogenerated/load-store-i1.s
index 33bcf6f9a..29d616961 100644
--- a/test/llvm_autogenerated/load-store-i1.s
+++ b/test/llvm_autogenerated/load-store-i1.s
@@ -16,12 +16,12 @@ load_u_i1_i32:
load_s_i1_i32:
.param i32
.result i32
+ i32.const $push3=, 0
i32.load8_u $push0=, 0($0)
- i32.const $push1=, 31
- i32.shl $push2=, $pop0, $pop1
- i32.const $push4=, 31
- i32.shr_s $push3=, $pop2, $pop4
- return $pop3
+ i32.const $push1=, 1
+ i32.and $push2=, $pop0, $pop1
+ i32.sub $push4=, $pop3, $pop2
+ return $pop4
.endfunc
.Lfunc_end1:
.size load_s_i1_i32, .Lfunc_end1-load_s_i1_i32
@@ -42,12 +42,12 @@ load_u_i1_i64:
load_s_i1_i64:
.param i32
.result i64
+ i64.const $push3=, 0
i64.load8_u $push0=, 0($0)
- i64.const $push1=, 63
- i64.shl $push2=, $pop0, $pop1
- i64.const $push4=, 63
- i64.shr_s $push3=, $pop2, $pop4
- return $pop3
+ i64.const $push1=, 1
+ i64.and $push2=, $pop0, $pop1
+ i64.sub $push4=, $pop3, $pop2
+ return $pop4
.endfunc
.Lfunc_end3:
.size load_s_i1_i64, .Lfunc_end3-load_s_i1_i64
diff --git a/test/llvm_autogenerated/load-store-i1.wast b/test/llvm_autogenerated/load-store-i1.wast
index b205c9073..68efcb4cc 100644
--- a/test/llvm_autogenerated/load-store-i1.wast
+++ b/test/llvm_autogenerated/load-store-i1.wast
@@ -17,14 +17,14 @@
)
(func $load_s_i1_i32 (param $0 i32) (result i32)
(return
- (i32.shr_s
- (i32.shl
+ (i32.sub
+ (i32.const 0)
+ (i32.and
(i32.load8_u
(get_local $0)
)
- (i32.const 31)
+ (i32.const 1)
)
- (i32.const 31)
)
)
)
@@ -37,14 +37,14 @@
)
(func $load_s_i1_i64 (param $0 i32) (result i64)
(return
- (i64.shr_s
- (i64.shl
+ (i64.sub
+ (i64.const 0)
+ (i64.and
(i64.load8_u
(get_local $0)
)
- (i64.const 63)
+ (i64.const 1)
)
- (i64.const 63)
)
)
)
diff --git a/test/llvm_autogenerated/reg-stackify.s b/test/llvm_autogenerated/reg-stackify.s
index ddf8b4c12..11a8e863b 100644
--- a/test/llvm_autogenerated/reg-stackify.s
+++ b/test/llvm_autogenerated/reg-stackify.s
@@ -449,6 +449,22 @@ stackpointer_dependency:
.Lfunc_end23:
.size stackpointer_dependency, .Lfunc_end23-stackpointer_dependency
+ .globl call_indirect_stackify
+ .type call_indirect_stackify,@function
+call_indirect_stackify:
+.Lfunc_begin24:
+ .param i32, i32
+ .result i32
+ i32.load $push4=, 0($0)
+ tee_local $push3=, $0=, $pop4
+ i32.load $push0=, 0($0)
+ i32.load $push1=, 0($pop0)
+ i32.call_indirect $push2=, $pop3, $1, $pop1
+ return $pop2
+ .endfunc
+.Lfunc_end24:
+ .size call_indirect_stackify, .Lfunc_end24-call_indirect_stackify
+
.hidden count
.type count,@object
.bss
diff --git a/test/llvm_autogenerated/reg-stackify.wast b/test/llvm_autogenerated/reg-stackify.wast
index 8c65949e0..121278e1d 100644
--- a/test/llvm_autogenerated/reg-stackify.wast
+++ b/test/llvm_autogenerated/reg-stackify.wast
@@ -1,8 +1,8 @@
(module
+ (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$v (func))
- (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(import "env" "blue" (func $blue (result i32)))
@@ -45,6 +45,7 @@
(export "no_stackify_past_epilogue" (func $no_stackify_past_epilogue))
(export "stackify_indvar" (func $stackify_indvar))
(export "stackpointer_dependency" (func $stackpointer_dependency))
+ (export "call_indirect_stackify" (func $call_indirect_stackify))
(func $no0 (param $0 i32) (param $1 i32) (result i32)
(set_local $1
(i32.load
@@ -574,5 +575,22 @@
(get_local $0)
)
)
+ (func $call_indirect_stackify (param $0 i32) (param $1 i32) (result i32)
+ (return
+ (call_indirect $FUNCSIG$iii
+ (tee_local $0
+ (i32.load
+ (get_local $0)
+ )
+ )
+ (get_local $1)
+ (i32.load
+ (i32.load
+ (get_local $0)
+ )
+ )
+ )
+ )
+ )
)
;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] }