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

Aarch64memorymanager ppc debug #1020

Closed
wants to merge 10 commits into from

Conversation

gmarkall
Copy link
Member

@gmarkall gmarkall commented Dec 7, 2023

For debugging #1009 on the PPC buildfarm machine.

gmarkall and others added 10 commits November 15, 2023 13:47
Copied verbatim from llvm/llvm-project@f28c006a5895, files:

```
llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
```
This makes them compliant with our C++ style check.
Notes on the changes:

- The memory manager is added to the build system.
- The `LlvmliteMemoryManager` class is exported as a public interface.
- When creating an execution engine, we set it to use our memory
  manager.
The implementation of `reserveAllocationSpace()` now more closely
follows that in llvm/llvm-project#71968,
following some changes made there.

The changes here include:

- Improved readability of debugging output
- Using a default alignment of 8 in `allocateSection()` to match the
  default alignment provided by the stub alignment during preallocation.
- Replacing the "bespoke" `requiredPageSize()` function with
  computations using the LLVM `alignTo()` function.
- Returning early from preallocation when no space is requested.
- Reusing existing preallocations if there is enough space left over
  from the previous preallocation for all the required segments - this
  can happen quite frequently because allocations for each segment get
  rounded up to page sizes, which are usually either 4K or 16K, and many
  Numba-jitted functions require a lot less than this.
- Removal of setting the near hints for memory blocks - this doesn't
  really have any use when all memory is preallocated, and forced to be
  "near" to other memory.
- Addition of extra asserts to validate alignment of allocated sections.
The default is to enable it on 64-bit ARM systems, since it solves the
problem they encounter, and disable it elsewhere, to minimise the risk
of an unintended side effect on platforms that don't need it.

This can be overridden by manually specifying the value of `use_lmm`
when creating the MCJIT compiler.
@gmarkall
Copy link
Member Author

gmarkall commented Dec 8, 2023

No longer needed.

@gmarkall gmarkall closed this Dec 8, 2023
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.

None yet

1 participant