-
Notifications
You must be signed in to change notification settings - Fork 727
Add support for metadata.code.call_targets section #4664
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
base: main
Are you sure you want to change the base?
Add support for metadata.code.call_targets section #4664
Conversation
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| bool used; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel it's simpler to have struct WASMCompilationHint common instead of duplicating individual fields.
| hint = hint->next; | ||
| } | ||
| if (hint != NULL) { | ||
| ((struct WASMCompilationHintBranchHint *)hint)->used = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to cast as the used field is in WASMCompilationHint as well.
| while (curr != NULL) { | ||
| if (!curr->used) { | ||
| printf("Unused hint for function %u, offset: %x\n", | ||
| i + module->import_count, curr->offset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually don't use printf.
maybe LOG_WARNING?
| uint64_t | ||
| aot_func_name_hash(const char *name) | ||
| { | ||
| return MD5Hash(StringRef(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this function ubiquitously available?
i suspect it isn't.
| struct WASMCompilationHint *next; | ||
| enum WASMCompilationHintType type; | ||
| uint32 offset; | ||
| bool used; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used field only for diagnostic purposes?
| return true; | ||
| fail: | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put a blank line between functions
Following #4460, I also implemented call targets hints in WAMR. Support in LLVM is tbd.
This also includes the generalization of our metadata parsing mechanism so that it'll be very easy to integrate new types of compilation metadata.
Basis: https://github.com/WebAssembly/compilation-hints/blob/main/proposals/compilation-hints/Overview.md