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

wamrc size_level heuristic #3356

Open
yamt opened this issue Apr 25, 2024 · 0 comments
Open

wamrc size_level heuristic #3356

yamt opened this issue Apr 25, 2024 · 0 comments

Comments

@yamt
Copy link
Collaborator

yamt commented Apr 25, 2024

currently wamrc frontend has some logic to tweak size_level.

if (!size_level_set) {
/**
* Set opt level to 1 by default for Windows and MacOS as
* they can not memory map out 0-2GB memory and might not
* be able to meet the requirements of some AOT relocation
* operations.
*/
if (option.target_abi && !strcmp(option.target_abi, "msvc")) {
LOG_VERBOSE("Set size level to 1 for Windows AOT file");
option.size_level = 1;
}
#if defined(_WIN32) || defined(_WIN32_) || defined(__APPLE__) \
|| defined(__MACH__)
if (!option.target_abi) {
LOG_VERBOSE("Set size level to 1 for Windows or MacOS AOT file");
option.size_level = 1;
}
#endif
}
if (sgx_mode) {
option.size_level = 1;
option.is_sgx_platform = true;
}

i guess it's more straightforward to do such a tweak in the backend (eg. aot_create_comp_context) instead because we have a better target knowledge there.
also, considering cross-aot-compiling, it's better to avoid decisions based on macros like _WIN32.

related: #3164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant