Skip to content

Conversation

@Lukasdoe
Copy link
Contributor

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

hint = hint->next;
}
if (hint != NULL) {
((struct WASMCompilationHintBranchHint *)hint)->used = true;
Copy link
Collaborator

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));
Copy link
Collaborator

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.

Copy link
Contributor Author

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;
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@Lukasdoe Lukasdoe requested a review from yamt November 28, 2025 17:20
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

Successfully merging this pull request may close these issues.

2 participants