summaryrefslogtreecommitdiff
path: root/test/passes/O3_low-memory-unused_metrics.txt
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-11-26 16:04:07 -0800
committerGitHub <noreply@github.com>2024-11-26 16:04:07 -0800
commit98f57983b0bbb05222ce45bb84cf8b87f36f03f1 (patch)
tree40c616768fd82a6c832873706c39d14535f25a4c /test/passes/O3_low-memory-unused_metrics.txt
parent73971d78e5355e8f08b4026b741992d78bd77476 (diff)
downloadbinaryen-98f57983b0bbb05222ce45bb84cf8b87f36f03f1.tar.gz
binaryen-98f57983b0bbb05222ce45bb84cf8b87f36f03f1.tar.bz2
binaryen-98f57983b0bbb05222ce45bb84cf8b87f36f03f1.zip
Handle concrete values in CodeFolding (#7117)
CodeFolding previously only worked on blocks that did not produce values. It worked on Ifs that produced values, but only by accident; the logic for folding matching tails was not written to support tails producing concrete values, but it happened to work for Ifs because subsequent ReFinalize runs fixed all the incorrect types it produced. Improve the power of the optimization by explicitly handling tails that produce concrete values for both blocks and ifs. Now that the core logic handles concrete values correctly, remove the unnecessary ReFinalize run. Also remove the separate optimization of Ifs with identical arms; this optimization requires ReFinalize and is already performed by OptimizeInstructions.
Diffstat (limited to 'test/passes/O3_low-memory-unused_metrics.txt')
-rw-r--r--test/passes/O3_low-memory-unused_metrics.txt438
1 files changed, 210 insertions, 228 deletions
diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt
index 8806e9a04..3117d7778 100644
--- a/test/passes/O3_low-memory-unused_metrics.txt
+++ b/test/passes/O3_low-memory-unused_metrics.txt
@@ -9,23 +9,23 @@ total
[table-data] : 0
[tables] : 0
[tags] : 0
- [total] : 1964
+ [total] : 1953
[vars] : 9
- Binary : 240
+ Binary : 238
Block : 68
Break : 90
Call : 22
CallIndirect : 1
- Const : 175
+ Const : 174
Drop : 8
If : 27
- Load : 313
- LocalGet : 633
- LocalSet : 181
+ Load : 311
+ LocalGet : 629
+ LocalSet : 180
Loop : 3
Return : 3
Select : 11
- Store : 160
+ Store : 159
Unary : 29
(module
(type $0 (func (param i32 i32 i32) (result i32)))
@@ -2718,307 +2718,289 @@ total
(local.get $0)
)
)
- (i32.store8
- (block $label$68 (result i32)
- (if
- (i32.eq
- (local.get $4)
- (i32.const 2)
- )
- (then
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
- )
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ (block $label$68
+ (if
+ (i32.eq
+ (local.get $4)
+ (i32.const 2)
+ )
+ (then
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (local.get $1)
+ (i32.const 1)
)
- (local.set $1
- (i32.load offset=48
- (local.get $0)
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (local.get $1)
+ )
+ (local.set $1
+ (i32.load offset=48
+ (local.get $0)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (i32.shr_u
- (local.get $1)
- (i32.const 8)
- )
- )
- (local.set $1
- (i32.load16_u offset=50
- (local.get $0)
- )
+ (i32.const 1)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
- (local.get $2)
- )
- )
+ (i32.shr_u
(local.get $1)
+ (i32.const 8)
)
- (local.set $1
- (i32.load8_u offset=51
- (local.get $0)
- )
- )
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ )
+ (local.set $1
+ (i32.load16_u offset=50
+ (local.get $0)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (local.get $1)
+ (i32.const 1)
)
- (local.set $1
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
(i32.load offset=8
- (local.get $0)
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (local.get $1)
+ )
+ (local.set $1
+ (i32.load8_u offset=51
+ (local.get $0)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (local.get $1)
+ (i32.const 1)
)
- (local.set $1
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
(i32.load offset=8
- (local.get $0)
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (local.get $1)
+ )
+ (local.set $1
+ (i32.load offset=8
+ (local.get $0)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (i32.shr_u
- (local.get $1)
- (i32.const 8)
- )
+ (i32.const 1)
)
- (local.set $1
- (i32.load16_u offset=10
- (local.get $0)
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (local.get $1)
+ )
+ (local.set $1
+ (i32.load offset=8
+ (local.get $0)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (local.get $1)
+ (i32.const 1)
)
- (local.set $3
- (i32.load8_u offset=11
- (local.get $0)
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $1
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (i32.shr_u
+ (local.get $1)
+ (i32.const 8)
)
- (br $label$68
- (i32.add
- (local.get $1)
- (i32.load offset=8
+ )
+ (local.set $1
+ (i32.load16_u offset=10
+ (local.get $0)
+ )
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
+ (i32.const 1)
)
)
- )
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
(local.get $2)
)
)
- (i32.const 1)
- )
- )
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
- (local.get $2)
- )
- )
- (i32.shr_u
(local.get $1)
- (i32.const 24)
)
- )
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $3
- (i32.load offset=20
- (local.get $2)
- )
+ (local.set $3
+ (i32.load8_u offset=11
+ (local.get $0)
)
- (i32.const 1)
)
+ (br $label$68)
)
- (i32.store8
- (i32.add
- (local.get $3)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (i32.shr_u
- (local.get $1)
- (i32.const 16)
- )
+ (i32.const 1)
)
- (local.set $3
- (i32.load offset=48
- (local.get $0)
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $1
- (i32.load offset=20
- (local.get $2)
- )
- )
- (i32.const 1)
- )
+ (i32.shr_u
+ (local.get $1)
+ (i32.const 24)
)
- (i32.store8
- (i32.add
- (local.get $1)
- (i32.load offset=8
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $3
+ (i32.load offset=20
(local.get $2)
)
)
- (i32.shr_u
- (local.get $3)
- (i32.const 8)
+ (i32.const 1)
+ )
+ )
+ (i32.store8
+ (i32.add
+ (local.get $3)
+ (i32.load offset=8
+ (local.get $2)
)
)
- (i32.store offset=20
- (local.get $2)
- (i32.add
- (local.tee $1
- (i32.load offset=20
- (local.get $2)
- )
+ (i32.shr_u
+ (local.get $1)
+ (i32.const 16)
+ )
+ )
+ (local.set $3
+ (i32.load offset=48
+ (local.get $0)
+ )
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $1
+ (i32.load offset=20
+ (local.get $2)
)
- (i32.const 1)
)
+ (i32.const 1)
)
+ )
+ (i32.store8
(i32.add
(local.get $1)
(i32.load offset=8
(local.get $2)
)
)
+ (i32.shr_u
+ (local.get $3)
+ (i32.const 8)
+ )
+ )
+ )
+ (i32.store offset=20
+ (local.get $2)
+ (i32.add
+ (local.tee $1
+ (i32.load offset=20
+ (local.get $2)
+ )
+ )
+ (i32.const 1)
+ )
+ )
+ (i32.store8
+ (i32.add
+ (local.get $1)
+ (i32.load offset=8
+ (local.get $2)
+ )
)
(local.get $3)
)