8000 gh-118306: Update JIT compilation to use LLVM 18 by savannahostrowski · Pull Request #118307 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-118306: Update JIT compilation to use LLVM 18 #118307

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

Merged
merged 32 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fef6cc0
Works for Linux Arm, Mac Arm broken
savannahostrowski Apr 25, 2024
3a5a0e9
uncomment
savannahostrowski Apr 25, 2024
186fef0
Minor updates for windows
savannahostrowski Apr 25, 2024
c0b63d2
llvm in CI
savannahostrowski Apr 25, 2024
8e31869
add brew update to gha
savannahostrowski Apr 25, 2024
ad6d554
remove file
savannahostrowski Apr 25, 2024
d546621
choco?
savannahostrowski Apr 25, 2024
2526e81
debugging windows runners
savannahostrowski Apr 25, 2024
9e0afdf
add -y
savannahostrowski Apr 25, 2024
b0ed125
add -y to choco for emulated windows
savannahostrowski Apr 25, 2024
3eeb3f0
instruction in jit.c and remove -mcmodel=large
savannahostrowski Apr 26, 2024
40bcebf
Fix instructions and MachO parsing
savannahostrowski Apr 26, 2024
c02ec00
remove mcmodel=large for aarch linux
savannahostrowski Apr 26, 2024
5d4dede
8000 add unhandled ELF instructions;
savannahostrowski Apr 26, 2024
bf5aa36
update workflow to install all llvm on native linux
savannahostrowski Apr 26, 2024
a79a39b
remove --with-lto
savannahostrowski Apr 26, 2024
dd283e3
remove lto from emulated linux
savannahostrowski Apr 26, 2024
8d59ff8
update comments
savannahostrowski Apr 26, 2024
9433e30
📜🤖 Added by blurb_it.
blurb-it[bot] Apr 26, 2024
6617ad4
update classes for ELF and MachO symbol types
savannahostrowski Apr 26, 2024
a9ef1f4
Merge branch 'llvm-18' of https://github.com/savannahostrowski/cpytho…
savannahostrowski Apr 26, 2024
02307e4
Merge branch 'main' into llvm-18
savannahostrowski Apr 26, 2024
8d9855f
Update .github/workflows/jit.yml
savannahostrowski Apr 26, 2024
72d366a
Update Tools/jit/_stencils.py
savannahostrowski Apr 26, 2024
fe17f68
Merge branch 'python:main' into llvm-18
savannahostrowski Apr 26, 2024
71954a0
address PR comments
savannahostrowski Apr 26, 2024
3d6d8c7
Merge branch 'llvm-18' of https://github.com/savannahostrowski/cpytho…
savannahostrowski Apr 26, 2024
80b9e1c
add -fPIC
savannahostrowski Apr 27, 2024
1808f6a
fix ordering of args for consistency
savannahostrowski Apr 27, 2024
b2bbeb0
Merge branch 'main' into llvm-18
savannahostrowski Apr 27, 2024
5717a81
Formatting nits
brandtbucher Apr 29, 2024
6c80a31
Merge branch 'main' into llvm-18
brandtbucher Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
Prev Previous commit
Next Next commit
address PR comments
  • Loading branch information
savannahostrowski committed Apr 26, 2024
commit 71954a04a8e2219bc625561b20113c2ef1ef60d8
2 changes: 1 addition & 1 deletion Python/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ patch(unsigned char *base, const Stencil *stencil, uintptr_t patches[])
assert((int64_t)value < (1LL << 31));
*loc32 = (uint32_t)value;
continue;
case HoleKind_ARM64_RELOC_BRANCH26:
case HoleKind_IMAGE_REL_ARM64_BRANCH26:
case HoleKind_R_AARCH64_CALL26:
case HoleKind_R_AARCH64_JUMP26:
case HoleKind_ARM64_RELOC_BRANCH26:
// 28-bit relative branch.
assert(IS_AARCH64_BRANCH(*loc32));
value -= (uintptr_t)location;
Expand Down
7 changes: 1 addition & 6 deletions Tools/jit/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ class COFFSection(typing.TypedDict):
SectionData: typing.NotRequired[dict[typing.Literal["Bytes"], list[int]]]
Symbols: list[dict[typing.Literal["Symbol"], _COFFSymbol]]

class _ElfSectionType(typing.TypedDict):
"""An ELF object file section type."""
Name: str
Value: int

class ELFSection(typing.TypedDict):
"""An ELF object file section."""

Expand All @@ -106,7 +101,7 @@ class ELFSection(typing.TypedDict):
Relocations: list[dict[typing.Literal["Relocation"], ELFRelocation]]
SectionData: dict[typing.Literal["Bytes"], list[int]]
Symbols: list[dict[typing.Literal["Symbol"], _ELFSymbol]]
Type: _ElfSectionType
Type: dict[typing.Literal["Name"], str]

class MachOSection(typing.TypedDict):
"""A Mach-O object file section."""
Expand Down
4 changes: 3 additions & 1 deletion Tools/jit/_stencils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ def process_relocations(self, *, alignment: int = 1) -> None:
"""Fix up all GOT and internal relocations for this stencil group."""
for hole in self.code.holes.copy():
if (
hole.kind in {"R_AARCH64_CALL26", "R_AARCH64_JUMP26", "ARM64_RELOC_BRANCH26"}
hole.kind in {
"R_AARCH64_CALL26", "R_AARCH64_JUMP26", "ARM64_RELOC_BRANCH26"
}
and hole.value is HoleValue.ZERO
):
self.code.pad(alignment)
Expand Down
0