diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-11-09 19:06:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 19:06:51 +0100 |
| commit | 7ac079f047ad9857a32593bc7607115183d13560 (patch) | |
| tree | 2503ded9fb1b8c40df9249b733c87c1766dedca1 | |
| parent | 62d3a4f9c25afe5251e1ba4165aefaf90d948b91 (diff) | |
| parent | 301bb123f424954cd3faee11bbbfb0605e5ae0e8 (diff) | |
| download | rust-7ac079f047ad9857a32593bc7607115183d13560.tar.gz rust-7ac079f047ad9857a32593bc7607115183d13560.zip | |
Rollup merge of #78566 - JRF63:polly, r=Mark-Simulacrum
Enable LLVM Polly via llvm-args. I think doing it this way is better than in #51061. Polly has other useful options and we probably don't want to create a `-Z` flag for each one of them.  [Benchmark](https://gist.github.com/JRF63/9a6268b91720958e90dbe7abffe20298) I noticed that `-lto` seems to interfere with polly in this specific microbenchmark, as enabling it causes the perf to drop to that of non-polly builds. Other related PRs: #75615
| -rw-r--r-- | config.toml.example | 3 | ||||
| -rw-r--r-- | src/bootstrap/config.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/native.rs | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/config.toml.example b/config.toml.example index 1edb390e0fe..1dcc5f13415 100644 --- a/config.toml.example +++ b/config.toml.example @@ -138,6 +138,9 @@ changelog-seen = 2 # Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES` #allow-old-toolchain = false +# Whether to include the Polly optimizer. +#polly = false + # ============================================================================= # General build configuration options # ============================================================================= diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 40ea9afb6f6..2fc121a2e86 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -99,6 +99,7 @@ pub struct Config { pub llvm_version_suffix: Option<String>, pub llvm_use_linker: Option<String>, pub llvm_allow_old_toolchain: Option<bool>, + pub llvm_polly: Option<bool>, pub llvm_from_ci: bool, pub use_lld: bool, @@ -418,6 +419,7 @@ struct Llvm { use_libcxx: Option<bool>, use_linker: Option<String>, allow_old_toolchain: Option<bool>, + polly: Option<bool>, download_ci_llvm: Option<StringOrBool>, } @@ -762,6 +764,7 @@ impl Config { set(&mut config.llvm_use_libcxx, llvm.use_libcxx); config.llvm_use_linker = llvm.use_linker.clone(); config.llvm_allow_old_toolchain = llvm.allow_old_toolchain; + config.llvm_polly = llvm.polly; config.llvm_from_ci = match llvm.download_ci_llvm { Some(StringOrBool::String(s)) => { assert!(s == "if-available", "unknown option `{}` for download-ci-llvm", s); @@ -795,6 +798,7 @@ impl Config { check_ci_llvm!(llvm.use_libcxx); check_ci_llvm!(llvm.use_linker); check_ci_llvm!(llvm.allow_old_toolchain); + check_ci_llvm!(llvm.polly); // CI-built LLVM is shared config.llvm_link_shared = true; diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 37d6fab070b..6dc83c7d70a 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -257,6 +257,10 @@ impl Step for Llvm { enabled_llvm_projects.push("compiler-rt"); } + if let Some(true) = builder.config.llvm_polly { + enabled_llvm_projects.push("polly"); + } + // We want libxml to be disabled. // See https://github.com/rust-lang/rust/pull/50104 cfg.define("LLVM_ENABLE_LIBXML2", "OFF"); |
