]> git.lizzy.rs Git - rust.git/commitdiff
Enable LLVM Polly via llvm-args.
authorJoseph Rafael Ferrer <rafael2x0@gmail.com>
Fri, 30 Oct 2020 10:19:56 +0000 (18:19 +0800)
committerJoseph Rafael Ferrer <rafael2x0@gmail.com>
Fri, 30 Oct 2020 10:23:02 +0000 (18:23 +0800)
config.toml.example
src/bootstrap/config.rs
src/bootstrap/native.rs

index 1edb390e0fef25e0334b6bf17cbe9f1ed7938a6b..1dcc5f13415dc8680ee00e119e33c3817c57635c 100644 (file)
@@ -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
 # =============================================================================
index 7698ff62880d6f76338f123a435bbb681e6c579a..8f6fbaebd2c5a62a0da6d5fa89461792b1648bd1 100644 (file)
@@ -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 @@ pub fn parse(args: &[String]) -> 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 @@ pub fn parse(args: &[String]) -> 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;
index 37d6fab070b8e1d28a9f37b679b50170918d3f54..6dc83c7d70af69c04868779bacb615ebc05ba31f 100644 (file)
@@ -257,6 +257,10 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
             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");