Skip to content

Commit 52e999a

Browse files
committed
Auto merge of #67759 - nikic:llvm-10, r=<try>
Update to LLVM 10 LLVM 10 is going to be branched soon, so it's a good time to start finding all those tasty new miscompiles and performance regressions ;) Status: * Preparation split off into #67900. * Optimization regressions: * [x] https://bugs.llvm.org/show_bug.cgi?id=44419 => https://reviews.llvm.org/D72048 has landed. * [x] https://bugs.llvm.org/show_bug.cgi?id=44423 => https://reviews.llvm.org/D72060 has landed. * [ ] https://reviews.llvm.org/D72169 submitted. * [ ] https://bugs.llvm.org/show_bug.cgi?id=44461 reported. https://reviews.llvm.org/D72420 submitted, but unlikely eligible for LLVM 10. * Compile-time regressions: * [x] GlobalOpt regression identified. ~~fhahn proposed https://reviews.llvm.org/D72214.~~ fhahn has [reverted](llvm/llvm-project@192cce1) the patch. * [ ] Even with the revert, there are [large regressions](https://perf.rust-lang.org/compare.html?start=760ce94c69ca510d44087291c311296f6d9ccdf5&end=4e84f97d76e694bb9f59039f5bdeb6d8bca46d14). * Assertion failures / infinite loops: * [x] https://bugs.llvm.org/show_bug.cgi?id=44600 => https://reviews.llvm.org/D73135, https://reviews.llvm.org/D73854 and https://reviews.llvm.org/D73908 have landed and been cherry-picked to the 10.x branch. * [x] https://bugs.llvm.org/show_bug.cgi?id=44835 => https://reviews.llvm.org/D74278 has landed and been cherry-picked. r? @ghost
2 parents e6ec0d1 + 7af7408 commit 52e999a

File tree

7 files changed

+32
-11
lines changed

7 files changed

+32
-11
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
[submodule "src/llvm-project"]
4141
path = src/llvm-project
4242
url = https://github.com/rust-lang/llvm-project.git
43-
branch = rustc/9.0-2019-12-19
43+
branch = rustc/10.0-2020-02-05
4444
[submodule "src/doc/embedded-book"]
4545
path = src/doc/embedded-book
4646
url = https://github.com/rust-embedded/book.git

src/bootstrap/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,8 @@ impl Step for Compiletest {
11401140
let llvm_config = builder.ensure(native::Llvm { target: builder.config.build });
11411141
if !builder.config.dry_run {
11421142
let llvm_version = output(Command::new(&llvm_config).arg("--version"));
1143+
// Remove trailing newline from llvm-config output.
1144+
let llvm_version = llvm_version.trim_end();
11431145
cmd.arg("--llvm-version").arg(llvm_version);
11441146
}
11451147
if !builder.is_rust_llvm(target) {

src/llvm-project

Submodule llvm-project updated 27738 files

src/rustllvm/PassWrapper.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ extern "C" void LLVMInitializePasses() {
5959
}
6060

6161
extern "C" void LLVMTimeTraceProfilerInitialize() {
62-
#if LLVM_VERSION_GE(9, 0)
62+
#if LLVM_VERSION_GE(10, 0)
63+
timeTraceProfilerInitialize(
64+
/* TimeTraceGranularity */ 0,
65+
/* ProcName */ "rustc");
66+
#elif LLVM_VERSION_GE(9, 0)
6367
timeTraceProfilerInitialize();
6468
#endif
6569
}

src/test/run-make-fulldeps/target-specs/my-awesome-platform.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
2+
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128",
33
"linker-flavor": "gcc",
44
"llvm-target": "i686-unknown-linux-gnu",
55
"target-endian": "little",

src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"pre-link-args": {"gcc": ["-m64"]},
3-
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
3+
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
44
"linker-flavor": "gcc",
55
"llvm-target": "x86_64-unknown-linux-gnu",
66
"target-endian": "little",

src/tools/compiletest/src/header.rs

+21-6
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ impl EarlyProps {
191191
return true;
192192
}
193193
if let Some(ref actual_version) = config.llvm_version {
194+
let actual_version = version_to_int(actual_version);
194195
if line.starts_with("min-llvm-version") {
195196
let min_version = line
196197
.trim_end()
@@ -199,7 +200,7 @@ impl EarlyProps {
199200
.expect("Malformed llvm version directive");
200201
// Ignore if actual version is smaller the minimum required
201202
// version
202-
&actual_version[..] < min_version
203+
actual_version < version_to_int(min_version)
203204
} else if line.starts_with("min-system-llvm-version") {
204205
let min_version = line
205206
.trim_end()
@@ -208,7 +209,7 @@ impl EarlyProps {
208209
.expect("Malformed llvm version directive");
209210
// Ignore if using system LLVM and actual version
210211
// is smaller the minimum required version
211-
config.system_llvm && &actual_version[..] < min_version
212+
config.system_llvm && actual_version < version_to_int(min_version)
212213
} else if line.starts_with("ignore-llvm-version") {
213214
// Syntax is: "ignore-llvm-version <version1> [- <version2>]"
214215
let range_components = line
@@ -219,15 +220,15 @@ impl EarlyProps {
219220
.take(3) // 3 or more = invalid, so take at most 3.
220221
.collect::<Vec<&str>>();
221222
match range_components.len() {
222-
1 => &actual_version[..] == range_components[0],
223+
1 => actual_version == version_to_int(range_components[0]),
223224
2 => {
224-
let v_min = range_components[0];
225-
let v_max = range_components[1];
225+
let v_min = version_to_int(range_components[0]);
226+
let v_max = version_to_int(range_components[1]);
226227
if v_max < v_min {
227228
panic!("Malformed LLVM version range: max < min")
228229
}
229230
// Ignore if version lies inside of range.
230-
&actual_version[..] >= v_min && &actual_version[..] <= v_max
231+
actual_version >= v_min && actual_version <= v_max
231232
}
232233
_ => panic!("Malformed LLVM version directive"),
233234
}
@@ -238,6 +239,20 @@ impl EarlyProps {
238239
false
239240
}
240241
}
242+
243+
fn version_to_int(version: &str) -> u32 {
244+
let version_without_suffix = version.split('-').next().unwrap();
245+
let components: Vec<u32> = version_without_suffix
246+
.split('.')
247+
.map(|s| s.parse().expect("Malformed version component"))
248+
.collect();
249+
match components.len() {
250+
1 => components[0] * 10000,
251+
2 => components[0] * 10000 + components[1] * 100,
252+
3 => components[0] * 10000 + components[1] * 100 + components[2],
253+
_ => panic!("Malformed version"),
254+
}
255+
}
241256
}
242257
}
243258

0 commit comments

Comments
 (0)