-
Notifications
You must be signed in to change notification settings - Fork 739
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
| 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.
| 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.
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.
Can you please elaborate a bit more on that? I don't understand what your concern is, since I'm not sure whether you are hinting at the availability of the MD5Hash function, which is part of LLVM's MD5.h support header, or something else.
| 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?
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.
more or less. It is definitely a hint that something is wrong if a hint is not used. We apply hints to all branch instructions, so if it is not used, we either missed it, or the referenced instruction does not exist (meaning an invalid compilation hint section).
However, since these hints are not mission-critical, I didn't want to assert that this is true.
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