1
Fork 0

Auto merge of #87570 - nikic:llvm-13, r=nagisa

Upgrade to LLVM 13

Work in progress update to LLVM 13. Main changes:

 * InlineAsm diagnostics reported using SrcMgr diagnostic kind are now handled. Previously these used a separate diag handler.
 * Codegen tests are updated for additional attributes.
 * Some data layouts have changed.
 * Switch `#[used]` attribute from `llvm.used` to `llvm.compiler.used` to avoid SHF_GNU_RETAIN flag introduced in https://reviews.llvm.org/D97448, which appears to trigger a bug in older versions of gold.
 * Set `LLVM_INCLUDE_TESTS=OFF` to avoid Python 3.6 requirement.

Upstream issues:

 * ~~https://bugs.llvm.org/show_bug.cgi?id=51210 (InlineAsm diagnostic reporting for module asm)~~ Fixed by 1558bb80c0.
 * ~~https://bugs.llvm.org/show_bug.cgi?id=51476 (Miscompile on AArch64 due to incorrect comparison elimination)~~ Fixed by 81b106584f.
 * https://bugs.llvm.org/show_bug.cgi?id=51207 (Can't set custom section flags anymore). Problematic change reverted in our fork, https://reviews.llvm.org/D107216 posted for upstream revert.
 * https://bugs.llvm.org/show_bug.cgi?id=51211 (Regression in codegen for #83623). This is an optimization regression that we may likely have to eat for this release. The fix for #83623 was based on an incorrect premise, and this needs to be properly addressed in the MergeICmps pass.

The [compile-time impact](https://perf.rust-lang.org/compare.html?start=ef9549b6c0efb7525c9b012148689c8d070f9bc0&end=0983094463497eec22d550dad25576a894687002) is mixed, but quite positive as LLVM upgrades go.

The LLVM 13 final release is scheduled for Sep 21st. The current nightly is scheduled for stable release on Oct 21st.

r? `@ghost`
This commit is contained in:
bors 2021-08-21 09:25:28 +00:00
commit db002a06ae
30 changed files with 202 additions and 169 deletions

View file

@ -14,7 +14,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}

View file

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-musl".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}

View file

@ -10,7 +10,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: Endian::Big, ..base },
}

View file

@ -9,7 +9,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-gnu".to_string(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
}

View file

@ -9,7 +9,7 @@ pub fn target() -> Target {
Target {
llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
pointer_width: 64,
data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
}

View file

@ -43,7 +43,7 @@ pub fn target() -> Target {
Target {
llvm_target: "wasm32-unknown-emscripten".to_string(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-f128:64-n32:64-S128-ni:1:10:20".to_string(),
arch: "wasm32".to_string(),
options: opts,
}

View file

@ -54,7 +54,7 @@ pub fn target() -> Target {
Target {
llvm_target: "wasm32-unknown-unknown".to_string(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128-ni:1:10:20".to_string(),
arch: "wasm32".to_string(),
options,
}

View file

@ -109,7 +109,7 @@ pub fn target() -> Target {
Target {
llvm_target: "wasm32-wasi".to_string(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128-ni:1:10:20".to_string(),
arch: "wasm32".to_string(),
options,
}

View file

@ -32,7 +32,7 @@ pub fn target() -> Target {
Target {
llvm_target: "wasm64-unknown-unknown".to_string(),
pointer_width: 64,
data_layout: "e-m:e-p:64:64-i64:64-n32:64-S128".to_string(),
data_layout: "e-m:e-p:64:64-i64:64-n32:64-S128-ni:1:10:20".to_string(),
arch: "wasm64".to_string(),
options,
}