diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/post-assemblyscript-finalize.txt | 40 | ||||
-rw-r--r-- | test/passes/post-assemblyscript-finalize.wast | 54 | ||||
-rw-r--r-- | test/passes/post-assemblyscript.txt | 263 | ||||
-rw-r--r-- | test/passes/post-assemblyscript.wast | 342 |
4 files changed, 0 insertions, 699 deletions
diff --git a/test/passes/post-assemblyscript-finalize.txt b/test/passes/post-assemblyscript-finalize.txt deleted file mode 100644 index fffd2bb29..000000000 --- a/test/passes/post-assemblyscript-finalize.txt +++ /dev/null @@ -1,40 +0,0 @@ -(module - (type $none_=>_none (func)) - (type $i32_=>_none (func (param i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import "rt" "retain" (func $~lib/rt/pure/__retain (param i32) (result i32))) - (import "rt" "release" (func $~lib/rt/pure/__release (param i32))) - (import "rt" "alloc" (func $~lib/rt/tlsf/__alloc (param i32 i32) (result i32))) - (func $eliminates.unnecessaryAllocation - (nop) - ) - (func $eliminates.unnecessaryPair (param $0 i32) - (drop - (local.get $0) - ) - ) - (func $eliminates.unnecessaryStaticPair - (nop) - ) - (func $eliminates.unnecessaryStaticRetain - (drop - (i32.const 272) - ) - ) - (func $eliminates.unnecessaryStaticRelease - (nop) - ) - (func $keeps.dynamicRetain (param $0 i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (func $keeps.dynamicRelease (param $0 i32) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) -) diff --git a/test/passes/post-assemblyscript-finalize.wast b/test/passes/post-assemblyscript-finalize.wast deleted file mode 100644 index 6de35b471..000000000 --- a/test/passes/post-assemblyscript-finalize.wast +++ /dev/null @@ -1,54 +0,0 @@ -;; FinalizeARC part of assemblyscript/tests/compiler/rc/optimize -(module - (import "rt" "retain" (func $~lib/rt/pure/__retain (param i32) (result i32))) - (import "rt" "release" (func $~lib/rt/pure/__release (param i32))) - (import "rt" "alloc" (func $~lib/rt/tlsf/__alloc (param i32) (param i32) (result i32))) - (func $eliminates.unnecessaryAllocation - (call $~lib/rt/pure/__release - (call $~lib/rt/pure/__retain - (call $~lib/rt/tlsf/__alloc - (i32.const 1) - (i32.const 0) - ) - ) - ) - ) - (func $eliminates.unnecessaryPair (param $0 i32) - (call $~lib/rt/pure/__release - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (func $eliminates.unnecessaryStaticPair - (call $~lib/rt/pure/__release - (call $~lib/rt/pure/__retain - (i32.const 272) - ) - ) - ) - (func $eliminates.unnecessaryStaticRetain - (drop - (call $~lib/rt/pure/__retain - (i32.const 272) - ) - ) - ) - (func $eliminates.unnecessaryStaticRelease - (call $~lib/rt/pure/__release - (i32.const 272) - ) - ) - (func $keeps.dynamicRetain (param $0 i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (func $keeps.dynamicRelease (param $0 i32) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) -) diff --git a/test/passes/post-assemblyscript.txt b/test/passes/post-assemblyscript.txt deleted file mode 100644 index 2b3111e91..000000000 --- a/test/passes/post-assemblyscript.txt +++ /dev/null @@ -1,263 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (import "rt" "retain" (func $~lib/rt/pure/__retain (param i32) (result i32))) - (import "rt" "release" (func $~lib/rt/pure/__release (param i32))) - (import "rc" "getRetainedRef" (func $getRetainedRef (result i32))) - (func $eliminates.linearArgument (param $0 i32) - (local.set $0 - (local.get $0) - ) - (nop) - ) - (func $eliminates.linearLocal (param $0 i32) - (local $1 i32) - (local.set $1 - (local.get $0) - ) - (nop) - ) - (func $eliminates.linearChain (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local.set $1 - (local.get $0) - ) - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $2) - ) - (nop) - (nop) - (nop) - ) - (func $eliminates.balancedReleases (param $0 i32) (param $cond i32) - (local $2 i32) - (local.set $2 - (local.get $0) - ) - (if - (local.get $cond) - (nop) - (nop) - ) - ) - (func $eliminates.partialReleases (param $0 i32) (param $cond i32) - (local $2 i32) - (local.set $2 - (local.get $0) - ) - (if - (local.get $cond) - (nop) - ) - ) - (func $eliminates.balancedRetains (param $0 i32) (param $cond1 i32) (param $cond2 i32) - (local $3 i32) - (if - (local.get $cond1) - (if - (local.get $cond2) - (local.set $3 - (local.get $0) - ) - (local.set $3 - (local.get $0) - ) - ) - (local.set $3 - (local.get $0) - ) - ) - (nop) - ) - (func $eliminates.balancedInsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (local.set $0 - (local.get $0) - ) - (nop) - (br $continue|0) - ) - (unreachable) - ) - ) - (func $eliminates.balancedOutsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (local.set $0 - (local.get $0) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (br $continue|0) - ) - (unreachable) - ) - (nop) - ) - (func $eliminates.balancedInsideOutsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (local.set $0 - (local.get $0) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (nop) - (local.set $0 - (local.get $0) - ) - (br $continue|0) - ) - (unreachable) - ) - (nop) - ) - (func $eliminates.balancedInsideOutsideLoopWithBranch (param $0 i32) (param $cond1 i32) (param $cond2 i32) - (local $flat i32) - (local.set $0 - (local.get $0) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond1) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (if - (local.get $cond2) - (block $block - (nop) - (return) - ) - ) - (nop) - (local.set $0 - (local.get $0) - ) - (br $continue|0) - ) - (unreachable) - ) - (nop) - ) - (func $eliminates.replace (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local.set $0 - (local.get $0) - ) - (local.set $1 - (local.get $1) - ) - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - (if - (i32.ne - (local.get $2) - (local.get $3) - ) - (local.set $2 - (local.get $2) - ) - (nop) - ) - (local.set $0 - (local.get $2) - ) - (nop) - (nop) - ) - (func $eliminates.replaceAlreadyRetained (param $0 i32) (result i32) - (local $1 i32) - (block $block - (local.set $0 - (local.get $0) - ) - (local.set $1 - (call $getRetainedRef) - ) - (nop) - (local.set $0 - (local.get $1) - ) - (return - (local.get $0) - ) - ) - ) - (func $keeps.partialRetains (param $0 i32) (param $cond i32) - (if - (local.get $cond) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $keeps.reachesReturn (param $0 i32) (param $cond i32) (result i32) - (block $block - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (if - (local.get $cond) - (return - (local.get $0) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (return - (i32.const 0) - ) - ) - ) -) diff --git a/test/passes/post-assemblyscript.wast b/test/passes/post-assemblyscript.wast deleted file mode 100644 index c79bfe1d9..000000000 --- a/test/passes/post-assemblyscript.wast +++ /dev/null @@ -1,342 +0,0 @@ -;; OptimizeARC part of assemblyscript/tests/compiler/rc/optimize -;; with flattening applied manually -(module - (import "rt" "retain" (func $~lib/rt/pure/__retain (param i32) (result i32))) - (import "rt" "release" (func $~lib/rt/pure/__release (param i32))) - (func $eliminates.linearArgument (param $0 i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $eliminates.linearLocal (param $0 i32) - (local $1 i32) - (local.set $1 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (call $~lib/rt/pure/__release - (local.get $1) - ) - ) - (func $eliminates.linearChain (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local.set $1 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (local.set $2 - (call $~lib/rt/pure/__retain - (local.get $1) - ) - ) - (local.set $3 - (call $~lib/rt/pure/__retain - (local.get $2) - ) - ) - (call $~lib/rt/pure/__release - (local.get $3) - ) - (call $~lib/rt/pure/__release - (local.get $2) - ) - (call $~lib/rt/pure/__release - (local.get $1) - ) - ) - (func $eliminates.balancedReleases (param $0 i32) (param $cond i32) - (local $2 i32) - (local.set $2 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (if - (local.get $cond) - (call $~lib/rt/pure/__release - (local.get $2) - ) - (call $~lib/rt/pure/__release - (local.get $2) - ) - ) - ) - (func $eliminates.partialReleases (param $0 i32) (param $cond i32) - ;; technically invalid but assumed to be never emitted - (local $2 i32) - (local.set $2 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (if - (local.get $cond) - (call $~lib/rt/pure/__release - (local.get $2) - ) - ) - ) - (func $eliminates.balancedRetains (param $0 i32) (param $cond1 i32) (param $cond2 i32) - (local $3 i32) - (if - (local.get $cond1) - (if - (local.get $cond2) - (local.set $3 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (local.set $3 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (local.set $3 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (call $~lib/rt/pure/__release - (local.get $3) - ) - ) - (func $eliminates.balancedInsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (br $continue|0) - ) - (unreachable) - ) - ) - (func $eliminates.balancedOutsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (br $continue|0) - ) - (unreachable) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $eliminates.balancedInsideOutsideLoop (param $0 i32) (param $cond i32) - (local $flat i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (br $continue|0) - ) - (unreachable) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $eliminates.balancedInsideOutsideLoopWithBranch (param $0 i32) (param $cond1 i32) (param $cond2 i32) - (local $flat i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (block $break|0 - (loop $continue|0 - (local.set $flat - (i32.eqz - (local.get $cond1) - ) - ) - (br_if $break|0 - (local.get $flat) - ) - (if - (local.get $cond2) - (block - (call $~lib/rt/pure/__release - (local.get $0) - ) - (return) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (br $continue|0) - ) - (unreachable) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $eliminates.replace (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (local.set $1 - (call $~lib/rt/pure/__retain - (local.get $1) - ) - ) - ;; flat - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - ;; /flat - (if - (i32.ne - (local.get $2) ;; flat (local.tee $2 (local.get $1)) - (local.get $3) ;; flat (local.tee $3 (local.get $0)) - ) - (local.set $2 - (call $~lib/rt/pure/__retain - (local.get $2) - ) - ) - (call $~lib/rt/pure/__release - (local.get $3) - ) - ) - (local.set $0 - (local.get $2) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (call $~lib/rt/pure/__release - (local.get $1) - ) - ) - (import "rc" "getRetainedRef" (func $getRetainedRef (result i32))) - (func $eliminates.replaceAlreadyRetained (param $0 i32) (result i32) - (local $1 i32) - (block - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (local.set $1 - (call $getRetainedRef) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (local.set $0 - (local.get $1) - ) - (return - (local.get $0) - ) - ) - ) - (func $keeps.partialRetains (param $0 i32) (param $cond i32) - (if - (local.get $cond) - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - ) - (func $keeps.reachesReturn (param $0 i32) (param $cond i32) (result i32) - (block - (local.set $0 - (call $~lib/rt/pure/__retain - (local.get $0) - ) - ) - (if - (local.get $cond) - (return - (local.get $0) - ) - ) - (call $~lib/rt/pure/__release - (local.get $0) - ) - (return - (i32.const 0) - ) - ) - ) -) |