-
Notifications
You must be signed in to change notification settings - Fork 824
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
Compiler configuration with -O
or -C
/--codegen
flag on wasmer
#1237
Comments
I think this is generally a good idea. But instead of having a Class 1: High-level features that Wasm programs depend on. Class 2: Low-level details that we can usually figure out a good default value for. Optimization level, overflow checks, For Class 1 they can be assigned first-level arguments for convenience of use, and Class 2 arguments can be put behind |
I agree with @losfair here and like the idea of having finer grained options exposed to user generally! I'm for this change with the qualifications mentioned! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still relevant. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Feel free to reopen the issue if it has been closed by mistake. |
Considering (i) #1212, (ii) we have multiple backends addressing different needs, (iii) we may add more profiling information or execution context, I'm more and more thinking about adding the very classical compiler
-C
/--codegen
option to thewasmer
executable. Here is a list of options I've in mind (inspired fromrustc
):-C opt-level=value
wherevalue
can be:0
to3
, where0
implies--generate-debug-info
(introduced in Add support for GDB JIT debugging #1212),s
andz
to optimise for speed or small size,wasm-opt
on the Wasm module before starting compilation, just an idea,-C backend-arguments=value
wherevalue
is different according to the backend:-C overflow-checks=yes/no
to check integer overflows,-C debuginfo=value
wherevalue
can be:0
for no debug info,1
for line tables only,2
for full debug information,-C profile-generate=value
to enable PGO (I assume it can work only with the LLVM backend for the moment, we don't support PGO in Singlepass or Cranelift, cc @nick),-C profile-use=value
to use a PGO profile file,-C target-cpu
andtarget-features
to cross-compile or to enable some specific features for a target,-C simd=yes/no
to replace the--enable-simd
option,-C thread=yes/no
to replace the--enable-thread
option,-C wasm-features=values
to replace the--enable-all
features,-C abi-arguments=values
wherevalue
depends on the ABI: emscripten or WASI, even if the current option (--em-entrypoint
,--em-symbol-map
,--dir
etc.) are for runtime only, not compile-time. We should find a way to simplify those options too, that's for another issue.And thus, we can have the very classical alias option
-Ovalue
for-C opt-level=value
.I think it is important to get a standard way to configure the backends and the compilations before adding too much options.
Also, it would imply to rethinkg a little bit the
wasmer
command. For the moment, we have the following commands:run
to compile and cache (if not cached), and run a module,cache
to clean the caches,validate
to validate a module.Here is my proposal:
build
to compile and cache a module,run
to compile and cache (if not cached), and run a module,cache
to clean the caches,validate
to validate a module.The new
build
command will offer the-O
and-C
options, whilerun
on the other hand will just assume default options and configurations.Thoughts?
Additional cc @syrusakbary @MarkMcCaskey
The text was updated successfully, but these errors were encountered: