Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to -mno-bulk-memory-opt #23126

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def get_clang_flags(user_args):
# Bulk memory may be enabled via threads or directly via -s.
if not settings.BULK_MEMORY:
flags.append('-mno-bulk-memory')
flags.append('-mno-bulk-memory-opt')
if '-mnontrapping-fptoint' not in user_args and '-mno-nontrapping-fptoint' not in user_args:
flags.append('-mno-nontrapping-fptoint')

Expand Down
8 changes: 4 additions & 4 deletions test/code_size/embind_hello_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 380,
"a.js": 9718,
"a.js.gz": 4291,
"a.wasm": 7626,
"a.wasm.gz": 3444,
"total": 17896,
"total_gz": 8115
"a.wasm": 7728,
"a.wasm.gz": 3502,
"total": 17998,
"total_gz": 8173
}
8 changes: 4 additions & 4 deletions test/code_size/embind_val_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 380,
"a.js": 6849,
"a.js.gz": 2947,
"a.wasm": 9506,
"a.wasm.gz": 4872,
"total": 16907,
"total_gz": 8199
"a.wasm": 9568,
"a.wasm.gz": 4911,
"total": 16969,
"total_gz": 8238
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl2_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 328,
"a.js": 4532,
"a.js.gz": 2315,
"a.wasm": 10377,
"a.wasm.gz": 6694,
"total": 15363,
"total_gz": 9337
"a.wasm": 10402,
"a.wasm.gz": 6704,
"total": 15388,
"total_gz": 9347
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl2_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"a.html": 346,
"a.html.gz": 262,
"a.js": 22232,
"a.js.gz": 11612,
"total": 22578,
"total_gz": 11874
"a.js": 22200,
"a.js.gz": 11582,
"total": 22546,
"total_gz": 11844
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 328,
"a.js": 4070,
"a.js.gz": 2158,
"a.wasm": 10377,
"a.wasm.gz": 6694,
"total": 14901,
"total_gz": 9180
"a.wasm": 10402,
"a.wasm.gz": 6704,
"total": 14926,
"total_gz": 9190
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"a.html": 346,
"a.html.gz": 262,
"a.js": 21758,
"a.js.gz": 11442,
"total": 22104,
"total_gz": 11704
"a.js": 21726,
"a.js.gz": 11415,
"total": 22072,
"total_gz": 11677
}
8 changes: 4 additions & 4 deletions test/code_size/random_printf_wasm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"a.html": 12589,
"a.html.gz": 6888,
"total": 12589,
"total_gz": 6888
"a.html": 12597,
"a.html.gz": 6882,
"total": 12597,
"total_gz": 6882
}
8 changes: 4 additions & 4 deletions test/code_size/random_printf_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"a.html": 17246,
"a.html.gz": 7510,
"total": 17246,
"total_gz": 7510
"a.html": 17195,
"a.html.gz": 7478,
"total": 17195,
"total_gz": 7478
}
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
128834
129168
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
128246
128617
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
170967
171298
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
142095
142418
Original file line number Diff line number Diff line change
@@ -1 +1 @@
144682
145005
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_lto.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
121779
121867
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
232469
232786
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_noexcept.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
131645
131975
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_wasmfs.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
168974
169227
8 changes: 4 additions & 4 deletions test/other/codesize/test_codesize_files_wasmfs.exports
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
p (memory)
q (__wasm_call_ctors)
r (main)
s (__indirect_function_table)
q (memory)
r (__wasm_call_ctors)
s (main)
t (__indirect_function_table)
3 changes: 3 additions & 0 deletions test/other/codesize/test_codesize_files_wasmfs.funcs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ $__cxxabiv1::__vmi_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__
$__cxxabiv1::__vmi_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
$__cxxabiv1::__vmi_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const
$__lockfile
$__memcpy
$__memset
$__pthread_mutex_lock
$__throw_bad_alloc_shim\28\29
$__unlockfile
Expand All @@ -36,6 +38,7 @@ $fflush
$is_equal\28std::type_info\20const*\2c\20std::type_info\20const*\2c\20bool\29
$main
$memcmp
$memmove
$operator\20delete\28void*\29
$operator\20new\28unsigned\20long\29
$pthread_mutex_init
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_wasmfs.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2915
2932
5 changes: 3 additions & 2 deletions test/other/codesize/test_codesize_files_wasmfs.imports
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ j (_wasmfs_get_preloaded_child_path)
k (_wasmfs_get_num_preloaded_files)
l (_wasmfs_get_num_preloaded_dirs)
m (_wasmfs_copy_preloaded_file_data)
n (_abort_js)
o (random_get)
n (_emscripten_memcpy_js)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because without -mno-bulk-memory-opt (part of this change) we were defaulting to using the bulk memory instruction here (by mistake).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here originally made it in via a rebaseline that I did this morning: ea87423. I normally don't land re-baselines without review if they include symbol changes like this, but this one slipped through.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, I didn't review the earlier rebaseline, so this seemed like a regression to me...

Maybe we should add some automation for the automatic rebaselining? Like a script that does it + does a check if it is "trivial". Anything aside from size changes within some range could show an error to the user and suggest investigation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a great idea.

Then contributors could run the script on their PRs too and we could maybe remove the slack on those tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #23146

o (_abort_js)
p (random_get)
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_wasmfs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6214
6247
5 changes: 3 additions & 2 deletions test/other/codesize/test_codesize_files_wasmfs.sent
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ j (_wasmfs_get_preloaded_child_path)
k (_wasmfs_get_num_preloaded_files)
l (_wasmfs_get_num_preloaded_dirs)
m (_wasmfs_copy_preloaded_file_data)
n (_abort_js)
o (random_get)
n (_emscripten_memcpy_js)
o (_abort_js)
p (random_get)
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_files_wasmfs.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49889
50973
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_hello_O0.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14544
14519
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_hello_O1.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2552
2535
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_O0.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
992
975
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_minimal_O1.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
393
376
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size.wasm.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14544
14519
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_no_asserts.wasm.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11737
11712
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_strict.wasm.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14544
14519
Loading