Skip to content

Commit 2c619a5

Browse files
committed
downloads: upgrade LLVM 18.0.8 -> 19.1.6
As part of this we also modernize the BOLT apply settings to follow the recommendations at https://llvm.org/devmtg/2024-03/slides/practical-use-of-bolt.pdf. This includes enabling support for loading hot code from a huge page at runtime. This should _just work_ and could result in perf wins via improved iTLB hit rate, etc.
1 parent c324093 commit 2c619a5

File tree

5 files changed

+44
-18
lines changed

5 files changed

+44
-18
lines changed

cpython-unix/build-cpython.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,12 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
259259
patch -p1 -i ${ROOT}/patch-pwd-remove-conditional.patch
260260
fi
261261

262-
# Adjust BOLT flags to yield better behavior. See inline details in patch.
263262
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then
263+
# Adjust BOLT flags to yield better behavior. See inline details in patch.
264264
patch -p1 -i ${ROOT}/patch-configure-bolt-flags.patch
265+
266+
# Adjust BOLT application flags to make use of modern LLVM features.
267+
patch -p1 -i ${ROOT}/patch-configure-bolt-apply-flags.patch
265268
fi
266269

267270
# The optimization make targets are both phony and non-phony. This leads
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index ee034e5a962..f1a69b7d4a7 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -2183,8 +2183,9 @@ then
6+
[m4_normalize("
7+
-update-debug-sections
8+
-reorder-blocks=ext-tsp
9+
- -reorder-functions=hfsort+
10+
+ -reorder-functions=cdsort
11+
-split-functions
12+
+ -split-strategy=cdsplit
13+
-icf=1
14+
-inline-all
15+
-split-eh
16+
@@ -2196,6 +2197,7 @@ then
17+
-dyno-stats
18+
-use-gnu-stack
19+
-frame-opt=hot
20+
+ -hugify
21+
")]
22+
)
23+
fi

pythonbuild/downloads.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,25 @@
185185
"version": "14.0.3+20220508",
186186
},
187187
# Remember to update LLVM_URL in src/release.rs whenever upgrading.
188-
"llvm-18-x86_64-linux": {
189-
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-gnu_only-x86_64-unknown-linux-gnu.tar.zst",
190-
"size": 242840506,
191-
"sha256": "080c233fc7d75031b187bbfef62a4f9abc01188effb0c68fbc7dc4bc7370ee5b",
192-
"version": "18.0.8+20240713",
188+
"llvm-19-x86_64-linux": {
189+
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-gnu_only-x86_64-unknown-linux-gnu.tar.zst",
190+
"size": 251277644,
191+
"sha256": "900bbb464d430e960ea97150e073395ae865332ce403e7c1e8f76640cab5e852",
192+
"version": "19.1.6+20241231",
193193
},
194194
# Remember to update LLVM_URL in src/release.rs whenever upgrading.
195195
"llvm-aarch64-macos": {
196-
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-aarch64-apple-darwin.tar.zst",
197-
"size": 136598617,
198-
"sha256": "320da8d639186e020e7d54cdc35b7a5473b36cef08fdf7b22c03b59a273ba593",
199-
"version": "18.0.8+20240713",
196+
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-aarch64-apple-darwin.tar.zst",
197+
"size": 143884729,
198+
"sha256": "c0252c7ebe0b20125fe592a12d43a693fcab0bfa3bec9def6b96b97087e0f765",
199+
"version": "19.1.6+20241231",
200200
},
201201
# Remember to update LLVM_URL in src/release.rs whenever upgrading.
202202
"llvm-x86_64-macos": {
203-
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-x86_64-apple-darwin.tar.zst",
204-
"size": 136599290,
205-
"sha256": "3032161d1cadb8996b07fe5762444c956842b5a7d798b2fcfe5a04574fdf7549",
206-
"version": "18.0.8+20240713",
203+
"url": "https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-x86_64-apple-darwin.tar.zst",
204+
"size": 143113277,
205+
"sha256": "e990dea9ff89e4202d358b477a43f2bd128b244926534b7c8bb29feeaada994e",
206+
"version": "19.1.6+20241231",
207207
},
208208
"m4": {
209209
"url": "https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz",

pythonbuild/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def clang_toolchain(host_platform: str, target_triple: str) -> str:
426426
if "musl" in target_triple:
427427
return "llvm-14-x86_64-linux"
428428
else:
429-
return "llvm-18-x86_64-linux"
429+
return "llvm-19-x86_64-linux"
430430
elif host_platform == "macos":
431431
if platform.mac_ver()[2] == "arm64":
432432
return "llvm-aarch64-macos"

src/release.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,14 +575,14 @@ pub fn produce_install_only_stripped(tar_gz_path: &Path, llvm_dir: &Path) -> Res
575575
static LLVM_URL: Lazy<Url> = Lazy::new(|| {
576576
if cfg!(target_os = "macos") {
577577
if std::env::consts::ARCH == "aarch64" {
578-
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-aarch64-apple-darwin.tar.zst").unwrap()
578+
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-aarch64-apple-darwin.tar.zst").unwrap()
579579
} else if std::env::consts::ARCH == "x86_64" {
580-
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-x86_64-apple-darwin.tar.zst").unwrap()
580+
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-x86_64-apple-darwin.tar.zst").unwrap()
581581
} else {
582582
panic!("unsupported macOS architecture");
583583
}
584584
} else if cfg!(target_os = "linux") {
585-
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20240713/llvm-18.0.8+20240713-gnu_only-x86_64-unknown-linux-gnu.tar.zst").unwrap()
585+
Url::parse("https://github.com/indygreg/toolchain-tools/releases/download/toolchain-bootstrap%2F20241231/llvm-19.1.6+20241231-gnu_only-x86_64-unknown-linux-gnu.tar.zst").unwrap()
586586
} else {
587587
panic!("unsupported platform");
588588
}

0 commit comments

Comments
 (0)