Skip to content

Commit 301bb12

Browse files
committed
Enable LLVM Polly via llvm-args.
1 parent 8df58ae commit 301bb12

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

config.toml.example

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ changelog-seen = 2
138138
# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
139139
#allow-old-toolchain = false
140140

141+
# Whether to include the Polly optimizer.
142+
#polly = false
143+
141144
# =============================================================================
142145
# General build configuration options
143146
# =============================================================================

src/bootstrap/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub struct Config {
9999
pub llvm_version_suffix: Option<String>,
100100
pub llvm_use_linker: Option<String>,
101101
pub llvm_allow_old_toolchain: Option<bool>,
102+
pub llvm_polly: Option<bool>,
102103
pub llvm_from_ci: bool,
103104

104105
pub use_lld: bool,
@@ -418,6 +419,7 @@ struct Llvm {
418419
use_libcxx: Option<bool>,
419420
use_linker: Option<String>,
420421
allow_old_toolchain: Option<bool>,
422+
polly: Option<bool>,
421423
download_ci_llvm: Option<StringOrBool>,
422424
}
423425

@@ -762,6 +764,7 @@ impl Config {
762764
set(&mut config.llvm_use_libcxx, llvm.use_libcxx);
763765
config.llvm_use_linker = llvm.use_linker.clone();
764766
config.llvm_allow_old_toolchain = llvm.allow_old_toolchain;
767+
config.llvm_polly = llvm.polly;
765768
config.llvm_from_ci = match llvm.download_ci_llvm {
766769
Some(StringOrBool::String(s)) => {
767770
assert!(s == "if-available", "unknown option `{}` for download-ci-llvm", s);
@@ -795,6 +798,7 @@ impl Config {
795798
check_ci_llvm!(llvm.use_libcxx);
796799
check_ci_llvm!(llvm.use_linker);
797800
check_ci_llvm!(llvm.allow_old_toolchain);
801+
check_ci_llvm!(llvm.polly);
798802

799803
// CI-built LLVM is shared
800804
config.llvm_link_shared = true;

src/bootstrap/native.rs

+4
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ impl Step for Llvm {
257257
enabled_llvm_projects.push("compiler-rt");
258258
}
259259

260+
if let Some(true) = builder.config.llvm_polly {
261+
enabled_llvm_projects.push("polly");
262+
}
263+
260264
// We want libxml to be disabled.
261265
// See https://github.com/rust-lang/rust/pull/50104
262266
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");

0 commit comments

Comments
 (0)