Skip to content

Commit 7ce71c3

Browse files
committed
Auto merge of #73526 - cuviper:rust-llvm11, r=nikic
Upgrade to LLVM 11 (rc2) This builds on #73525 to try actually moving rust-lang/llvm-project to LLVM 11.
2 parents e482c86 + b450c0c commit 7ce71c3

File tree

7 files changed

+32
-38
lines changed

7 files changed

+32
-38
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
[submodule "src/llvm-project"]
3838
path = src/llvm-project
3939
url = https://github.com/rust-lang/llvm-project.git
40-
branch = rustc/10.0-2020-05-05
40+
branch = rustc/11.0-2020-08-20
4141
[submodule "src/doc/embedded-book"]
4242
path = src/doc/embedded-book
4343
url = https://github.com/rust-embedded/book.git

src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@ cd clang-build
1818
# For whatever reason the default set of include paths for clang is different
1919
# than that of gcc. As a result we need to manually include our sysroot's
2020
# include path, /rustroot/include, to clang's default include path.
21-
#
22-
# Alsow there's this weird oddity with gcc where there's an 'include-fixed'
23-
# directory that it generates. It turns out [1] that Centos 5's headers are so
24-
# old that they're incompatible with modern C semantics. While gcc automatically
25-
# fixes that clang doesn't account for this. Tell clang to manually include the
26-
# fixed headers so we can successfully compile code later on.
27-
#
28-
# [1]: https://sourceware.org/ml/crossgcc/2008-11/msg00028.html
29-
INC="/rustroot/include"
30-
INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed"
31-
INC="$INC:/usr/include"
21+
INC="/rustroot/include:/usr/include"
3222

3323
hide_output \
3424
cmake ../llvm \

src/llvm-project

Submodule llvm-project updated 37694 files

src/rustllvm/CoverageMappingWrapper.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "llvm/ProfileData/Coverage/CoverageMappingWriter.h"
44
#include "llvm/ProfileData/InstrProf.h"
55
#include "llvm/ADT/ArrayRef.h"
6+
#include "llvm/Support/LEB128.h"
67

78
#include <iostream>
89

@@ -12,14 +13,15 @@ extern "C" void LLVMRustCoverageWriteFilenamesSectionToBuffer(
1213
const char* const Filenames[],
1314
size_t FilenamesLen,
1415
RustStringRef BufferOut) {
15-
SmallVector<StringRef,32> FilenameRefs;
16+
// LLVM 11's CoverageFilenamesSectionWriter uses its new `Version4` format,
17+
// so we're manually writing the `Version3` format ourselves.
18+
RawRustStringOstream OS(BufferOut);
19+
encodeULEB128(FilenamesLen, OS);
1620
for (size_t i = 0; i < FilenamesLen; i++) {
17-
FilenameRefs.push_back(StringRef(Filenames[i]));
21+
StringRef Filename(Filenames[i]);
22+
encodeULEB128(Filename.size(), OS);
23+
OS << Filename;
1824
}
19-
auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
20-
makeArrayRef(FilenameRefs));
21-
RawRustStringOstream OS(BufferOut);
22-
FilenamesWriter.write(OS);
2325
}
2426

2527
extern "C" void LLVMRustCoverageWriteMappingToBuffer(
@@ -64,5 +66,5 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
6466
}
6567

6668
extern "C" uint32_t LLVMRustCoverageMappingVersion() {
67-
return coverage::CovMapVersion::CurrentVersion;
69+
return coverage::CovMapVersion::Version3;
6870
}

src/test/assembly/asm/riscv-types.rs

+16-15
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pub unsafe fn sym_fn() {
5555

5656
// CHECK-LABEL: sym_static:
5757
// CHECK: #APP
58-
// CHECK: lb t0, extern_static
58+
// CHECK: auipc t0, %pcrel_hi(extern_static)
59+
// CHECK: lb t0, %pcrel_lo(.Lpcrel_hi0)(t0)
5960
// CHECK: #NO_APP
6061
#[no_mangle]
6162
pub unsafe fn sym_static() {
@@ -98,45 +99,45 @@ macro_rules! check_reg {
9899

99100
// CHECK-LABEL: reg_i8:
100101
// CHECK: #APP
101-
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
102+
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
102103
// CHECK: #NO_APP
103104
check!(reg_i8 i8 reg "mv");
104105

105106
// CHECK-LABEL: reg_i16:
106107
// CHECK: #APP
107-
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
108+
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
108109
// CHECK: #NO_APP
109110
check!(reg_i16 i16 reg "mv");
110111

111112
// CHECK-LABEL: reg_i32:
112113
// CHECK: #APP
113-
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
114+
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
114115
// CHECK: #NO_APP
115116
check!(reg_i32 i32 reg "mv");
116117

117118
// CHECK-LABEL: reg_f32:
118119
// CHECK: #APP
119-
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
120+
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
120121
// CHECK: #NO_APP
121122
check!(reg_f32 f32 reg "mv");
122123

123124
// riscv64-LABEL: reg_i64:
124125
// riscv64: #APP
125-
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
126+
// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
126127
// riscv64: #NO_APP
127128
#[cfg(riscv64)]
128129
check!(reg_i64 i64 reg "mv");
129130

130131
// riscv64-LABEL: reg_f64:
131132
// riscv64: #APP
132-
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
133+
// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
133134
// riscv64: #NO_APP
134135
#[cfg(riscv64)]
135136
check!(reg_f64 f64 reg "mv");
136137

137138
// CHECK-LABEL: reg_ptr:
138139
// CHECK: #APP
139-
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
140+
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
140141
// CHECK: #NO_APP
141142
check!(reg_ptr ptr reg "mv");
142143

@@ -154,45 +155,45 @@ check!(freg_f64 f64 freg "fmv.d");
154155

155156
// CHECK-LABEL: a0_i8:
156157
// CHECK: #APP
157-
// CHECK: mv a0, a0
158+
// CHECK: add a0, zero, a0
158159
// CHECK: #NO_APP
159160
check_reg!(a0_i8 i8 "a0" "mv");
160161

161162
// CHECK-LABEL: a0_i16:
162163
// CHECK: #APP
163-
// CHECK: mv a0, a0
164+
// CHECK: add a0, zero, a0
164165
// CHECK: #NO_APP
165166
check_reg!(a0_i16 i16 "a0" "mv");
166167

167168
// CHECK-LABEL: a0_i32:
168169
// CHECK: #APP
169-
// CHECK: mv a0, a0
170+
// CHECK: add a0, zero, a0
170171
// CHECK: #NO_APP
171172
check_reg!(a0_i32 i32 "a0" "mv");
172173

173174
// CHECK-LABEL: a0_f32:
174175
// CHECK: #APP
175-
// CHECK: mv a0, a0
176+
// CHECK: add a0, zero, a0
176177
// CHECK: #NO_APP
177178
check_reg!(a0_f32 f32 "a0" "mv");
178179

179180
// riscv64-LABEL: a0_i64:
180181
// riscv64: #APP
181-
// riscv64: mv a0, a0
182+
// riscv64: add a0, zero, a0
182183
// riscv64: #NO_APP
183184
#[cfg(riscv64)]
184185
check_reg!(a0_i64 i64 "a0" "mv");
185186

186187
// riscv64-LABEL: a0_f64:
187188
// riscv64: #APP
188-
// riscv64: mv a0, a0
189+
// riscv64: add a0, zero, a0
189190
// riscv64: #NO_APP
190191
#[cfg(riscv64)]
191192
check_reg!(a0_f64 f64 "a0" "mv");
192193

193194
// CHECK-LABEL: a0_ptr:
194195
// CHECK: #APP
195-
// CHECK: mv a0, a0
196+
// CHECK: add a0, zero, a0
196197
// CHECK: #NO_APP
197198
check_reg!(a0_ptr ptr "a0" "mv");
198199

src/test/codegen/scalar-pair-bool.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ pub fn pair_i32_bool(pair: (i32, bool)) -> (i32, bool) {
2424
#[no_mangle]
2525
pub fn pair_and_or((a, b): (bool, bool)) -> (bool, bool) {
2626
// Make sure it can operate directly on the unpacked args
27-
// CHECK: and i1 %_1.0, %_1.1
28-
// CHECK: or i1 %_1.0, %_1.1
27+
// (but it might not be using simple and/or instructions)
28+
// CHECK-DAG: %_1.0
29+
// CHECK-DAG: %_1.1
2930
(a && b, a || b)
3031
}
3132

src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
}
5656
],
5757
"type": "llvm.coverage.json.export",
58-
"version": "2.0.0"
58+
"version": "2.0.1"
5959
}

0 commit comments

Comments
 (0)