[JITLink] Design a JITLinkMemoryManager memory-layout-information scheme
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
[`JITLinkMemoryManager`](https://github.com/llvm/llvm-project/blob/dbc206f35d36370b9adac7868eb319799de7abe1/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h#L47) provides memory allocation on a per-`LinkGraph` basis. At present there's no way for a `JITLinkMemoryManager` implementation to describe constraints on the memory that it will provide to JITLink, and this constrains the optimizations that JITLink can apply by default.
E.g. JITLink currently builds GOT and PLT entries for all calls to symbols outside the current graph, conservatively assuming that these may be allocated out of range for the current code model. If the LinkGraph could reflect which JITDylib each external symbol was defined in (see https://github.com/llvm/llvm-project/issues/190106), and the JITLinkMemoryManager could communicate that allocated memory will satisfy "in-range-for-code-model" then we could drop GOT/PLT entries for symbols in the same JITDylib (which is probably most symbols).
Contributor guide
Assessment
This issue has not been assessed yet.