summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-27 19:40:08 +0000
committerGitHub <noreply@github.com>2021-01-27 11:40:08 -0800
commit5331e9d18b9359aa0e9d6e0df455883f62e46ea0 (patch)
tree7114cb1190a1a2c6c886b267092d613d74ad50b9 /test/passes
parent2bdc4841b680ee44e132bbb07f5167eaa7226f99 (diff)
downloadbinaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.tar.gz
binaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.tar.bz2
binaryen-5331e9d18b9359aa0e9d6e0df455883f62e46ea0.zip
Simplfy getExpressionName (#3522)
This used to return a simple name like "if" for an If, but it is redundant with our proper printing logic. This PR turns it into a trivial helper that just prints out the name of the class, so it now prints "If" with a capital. That is useful for some logging, like in Metrics I think it is clearer than it was earlier (since we are actually counting the classes, and our old emitting of text-format-like names are just confusing, as we emitted "binary" there which is not valid). Also replace some usages of that method with proper printing.
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/O3_low-memory-unused_metrics.txt32
-rw-r--r--test/passes/converge_O3_metrics.bin.txt60
-rw-r--r--test/passes/func-metrics.txt48
-rw-r--r--test/passes/fuzz_metrics_noprint.bin.txt40
-rw-r--r--test/passes/metrics_all-features.txt10
-rw-r--r--test/passes/metrics_strip-debug_metrics.bin.txt4
-rw-r--r--test/passes/metrics_strip-producers_metrics.bin.txt4
-rw-r--r--test/passes/print_g_metrics.bin.txt22
-rw-r--r--test/passes/too_much_for_liveness.bin.txt16
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt56
10 files changed, 146 insertions, 146 deletions
diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt
index ce7ea2333..1ec56ef2c 100644
--- a/test/passes/O3_low-memory-unused_metrics.txt
+++ b/test/passes/O3_low-memory-unused_metrics.txt
@@ -8,22 +8,22 @@ total
[table-data] : 0
[total] : 1964
[vars] : 9
- binary : 240
- block : 68
- break : 90
- call : 22
- call_indirect : 1
- const : 175
- drop : 8
- if : 27
- load : 313
- local.get : 633
- local.set : 181
- loop : 3
- return : 3
- select : 11
- store : 160
- unary : 29
+ Binary : 240
+ Block : 68
+ Break : 90
+ Call : 22
+ CallIndirect : 1
+ Const : 175
+ Drop : 8
+ If : 27
+ Load : 313
+ LocalGet : 633
+ LocalSet : 181
+ Loop : 3
+ Return : 3
+ Select : 11
+ Store : 160
+ Unary : 29
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt
index bb68dd500..1764458f6 100644
--- a/test/passes/converge_O3_metrics.bin.txt
+++ b/test/passes/converge_O3_metrics.bin.txt
@@ -8,21 +8,21 @@ total
[table-data] : 429
[total] : 129
[vars] : 4
- binary : 12
- block : 8
- break : 3
- call : 3
- call_indirect : 4
- const : 45
- drop : 3
- global.get : 1
- global.set : 1
- if : 2
- load : 16
- local.get : 18
- local.set : 7
- loop : 1
- store : 5
+ Binary : 12
+ Block : 8
+ Break : 3
+ Call : 3
+ CallIndirect : 4
+ Const : 45
+ Drop : 3
+ GlobalGet : 1
+ GlobalSet : 1
+ If : 2
+ Load : 16
+ LocalGet : 18
+ LocalSet : 7
+ Loop : 1
+ Store : 5
(module
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
@@ -249,21 +249,21 @@ total
[table-data] : 429
[total] : 129
[vars] : 4
- binary : 12
- block : 8
- break : 3
- call : 3
- call_indirect : 4
- const : 45
- drop : 3
- global.get : 1
- global.set : 1
- if : 2
- load : 16
- local.get : 18
- local.set : 7
- loop : 1
- store : 5
+ Binary : 12
+ Block : 8
+ Break : 3
+ Call : 3
+ CallIndirect : 4
+ Const : 45
+ Drop : 3
+ GlobalGet : 1
+ GlobalSet : 1
+ If : 2
+ Load : 16
+ LocalGet : 18
+ LocalSet : 7
+ Loop : 1
+ Store : 5
(module
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt
index 44476f975..117d9baf7 100644
--- a/test/passes/func-metrics.txt
+++ b/test/passes/func-metrics.txt
@@ -7,30 +7,30 @@ global
[memory-data] : 9
[table-data] : 3
[total] : 3
- const : 3
+ Const : 3
func: empty
[binary-bytes] : 3
[total] : 1
[vars] : 0
- nop : 1
+ Nop : 1
func: small
[binary-bytes] : 9
[total] : 5
[vars] : 0
- block : 1
- const : 1
- drop : 1
- nop : 1
- return : 1
+ Block : 1
+ Const : 1
+ Drop : 1
+ Nop : 1
+ Return : 1
func: ifs
[binary-bytes] : 51
[total] : 24
[vars] : 1
- binary : 1
- block : 1
- const : 12
- drop : 6
- if : 4
+ Binary : 1
+ Block : 1
+ Const : 12
+ Drop : 6
+ If : 4
(module
(type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
@@ -109,20 +109,20 @@ func: func_a
[binary-bytes] : 16
[total] : 8
[vars] : 0
- block : 1
- call : 7
+ Block : 1
+ Call : 7
func: func_b
[binary-bytes] : 22
[total] : 11
[vars] : 0
- block : 1
- call : 10
+ Block : 1
+ Call : 10
func: func_c
[binary-bytes] : 32
[total] : 16
[vars] : 0
- block : 1
- call : 15
+ Block : 1
+ Call : 15
export: a (func_a)
[removable-bytes-without-it]: 72
[total] : 0
@@ -184,8 +184,8 @@ func: func_a
[binary-bytes] : 12
[total] : 6
[vars] : 0
- block : 1
- call : 5
+ Block : 1
+ Call : 5
export: a (func_a)
[removable-bytes-without-it]: 7
[total] : 0
@@ -216,8 +216,8 @@ func: func_a
[binary-bytes] : 12
[total] : 6
[vars] : 0
- block : 1
- call : 5
+ Block : 1
+ Call : 5
start: func_a
[removable-bytes-without-it]: 57
[total] : 0
@@ -240,12 +240,12 @@ global
[globals] : 1
[imports] : 1
[total] : 1
- global.get : 1
+ GlobalGet : 1
func: 0
[binary-bytes] : 4
[total] : 1
[vars] : 0
- global.get : 1
+ GlobalGet : 1
export: stackSave (0)
[removable-bytes-without-it]: 56
[total] : 0
diff --git a/test/passes/fuzz_metrics_noprint.bin.txt b/test/passes/fuzz_metrics_noprint.bin.txt
index 9e9b6f4f8..13861d353 100644
--- a/test/passes/fuzz_metrics_noprint.bin.txt
+++ b/test/passes/fuzz_metrics_noprint.bin.txt
@@ -8,23 +8,23 @@ total
[table-data] : 18
[total] : 4870
[vars] : 236
- binary : 368
- block : 699
- break : 191
- call : 300
- call_indirect : 39
- const : 847
- drop : 91
- global.get : 403
- global.set : 171
- if : 260
- load : 85
- local.get : 374
- local.set : 251
- loop : 111
- nop : 86
- return : 187
- select : 30
- store : 36
- unary : 340
- unreachable : 1
+ Binary : 368
+ Block : 699
+ Break : 191
+ Call : 300
+ CallIndirect : 39
+ Const : 847
+ Drop : 91
+ GlobalGet : 403
+ GlobalSet : 171
+ If : 260
+ Load : 85
+ LocalGet : 374
+ LocalSet : 251
+ Loop : 111
+ Nop : 86
+ Return : 187
+ Select : 30
+ Store : 36
+ Unary : 340
+ Unreachable : 1
diff --git a/test/passes/metrics_all-features.txt b/test/passes/metrics_all-features.txt
index 5d7a92ae1..79381a62d 100644
--- a/test/passes/metrics_all-features.txt
+++ b/test/passes/metrics_all-features.txt
@@ -8,11 +8,11 @@ total
[table-data] : 3
[total] : 27
[vars] : 1
- binary : 1
- block : 1
- const : 15
- drop : 6
- if : 4
+ Binary : 1
+ Block : 1
+ Const : 15
+ Drop : 6
+ If : 4
(module
(type $i32_=>_none (func (param i32)))
(type $i32_i32_=>_none (func (param i32 i32)))
diff --git a/test/passes/metrics_strip-debug_metrics.bin.txt b/test/passes/metrics_strip-debug_metrics.bin.txt
index 5d1ba4b6e..f873992bb 100644
--- a/test/passes/metrics_strip-debug_metrics.bin.txt
+++ b/test/passes/metrics_strip-debug_metrics.bin.txt
@@ -6,7 +6,7 @@ total
[imports] : 0
[total] : 1
[vars] : 0
- nop : 1
+ Nop : 1
total
[events] : 0
[exports] : 1
@@ -15,7 +15,7 @@ total
[imports] : 0
[total] : 1
[vars] : 0
- nop : 1
+ Nop : 1
(module
(type $none_=>_none (func))
(export "a" (func $0))
diff --git a/test/passes/metrics_strip-producers_metrics.bin.txt b/test/passes/metrics_strip-producers_metrics.bin.txt
index 991b5a972..f20d10e0b 100644
--- a/test/passes/metrics_strip-producers_metrics.bin.txt
+++ b/test/passes/metrics_strip-producers_metrics.bin.txt
@@ -6,7 +6,7 @@ total
[imports] : 0
[total] : 1
[vars] : 0
- nop : 1
+ Nop : 1
total
[events] : 0
[exports] : 1
@@ -15,7 +15,7 @@ total
[imports] : 0
[total] : 1
[vars] : 0
- nop : 1
+ Nop : 1
(module
(type $none_=>_none (func))
(export "a" (func $0))
diff --git a/test/passes/print_g_metrics.bin.txt b/test/passes/print_g_metrics.bin.txt
index 3d3d1f1be..57a1d2745 100644
--- a/test/passes/print_g_metrics.bin.txt
+++ b/test/passes/print_g_metrics.bin.txt
@@ -72,17 +72,17 @@ total
[imports] : 0
[total] : 37
[vars] : 0
- binary : 11
- block : 2
- break : 1
- const : 8
- global.get : 1
- global.set : 1
- if : 1
- local.get : 8
- local.set : 2
- loop : 1
- nop : 1
+ Binary : 11
+ Block : 2
+ Break : 1
+ Const : 8
+ GlobalGet : 1
+ GlobalSet : 1
+ If : 1
+ LocalGet : 8
+ LocalSet : 2
+ Loop : 1
+ Nop : 1
(module
(type $none_=>_none (func))
(type $i32_=>_i32 (func (param i32) (result i32)))
diff --git a/test/passes/too_much_for_liveness.bin.txt b/test/passes/too_much_for_liveness.bin.txt
index 62aaf25f1..1d0e2df2d 100644
--- a/test/passes/too_much_for_liveness.bin.txt
+++ b/test/passes/too_much_for_liveness.bin.txt
@@ -6,10 +6,10 @@ total
[imports] : 0
[total] : 4
[vars] : 65536
- block : 1
- const : 1
- local.get : 1
- local.set : 1
+ Block : 1
+ Const : 1
+ LocalGet : 1
+ LocalSet : 1
total
[events] : 0
[exports] : 1
@@ -18,10 +18,10 @@ total
[imports] : 0
[total] : 4
[vars] : 65536
- block : 1
- const : 1
- local.get : 1
- local.set : 1
+ Block : 1
+ Const : 1
+ LocalGet : 1
+ LocalSet : 1
(module
(type $none_=>_i32 (func (result i32)))
(export "foo" (func $0))
diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
index c11b58362..083d7ce8f 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -8,31 +8,31 @@ total
[table-data] : 1
[total] : 461
[vars] : 11
- atomic.rmw : 1
- binary : 72
- block : 40
- break : 5
- call : 13
- call_ref : 1
- const : 124
- drop : 3
- global.get : 20
- global.set : 11
- i31.get : 1
- i31.new : 8
- if : 17
- load : 19
- local.get : 34
- local.set : 18
- loop : 4
- memory.init : 1
- nop : 8
- ref.func : 1
- ref.null : 11
- return : 14
- select : 1
- simd_extract : 2
- store : 3
- tuple.extract : 1
- tuple.make : 8
- unary : 20
+ AtomicRMW : 1
+ Binary : 72
+ Block : 40
+ Break : 5
+ Call : 13
+ CallRef : 1
+ Const : 124
+ Drop : 3
+ GlobalGet : 20
+ GlobalSet : 11
+ I31Get : 1
+ I31New : 8
+ If : 17
+ Load : 19
+ LocalGet : 34
+ LocalSet : 18
+ Loop : 4
+ MemoryInit : 1
+ Nop : 8
+ RefFunc : 1
+ RefNull : 11
+ Return : 14
+ SIMDExtract : 2
+ Select : 1
+ Store : 3
+ TupleExtract : 1
+ TupleMake : 8
+ Unary : 20