Auto merge of #83387 - cuviper:min-llvm-10, r=nagisa
Update the minimum external LLVM to 10 r? `@nikic`
This commit is contained in:
commit
6e17a5c5fd
16 changed files with 19 additions and 137 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -43,7 +43,7 @@ jobs:
|
||||||
- name: mingw-check
|
- name: mingw-check
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-llvm-9
|
- name: x86_64-gnu-llvm-10
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
|
@ -265,7 +265,7 @@ jobs:
|
||||||
- name: x86_64-gnu-distcheck
|
- name: x86_64-gnu-distcheck
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-llvm-9
|
- name: x86_64-gnu-llvm-10
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
|
|
|
@ -101,10 +101,6 @@ fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn strip_x86_address_spaces(data_layout: String) -> String {
|
|
||||||
data_layout.replace("-p270:32:32-p271:32:32-p272:64:64-", "-")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn strip_powerpc64_vectors(data_layout: String) -> String {
|
fn strip_powerpc64_vectors(data_layout: String) -> String {
|
||||||
data_layout.replace("-v256:256:256-v512:512:512", "")
|
data_layout.replace("-v256:256:256-v512:512:512", "")
|
||||||
}
|
}
|
||||||
|
@ -119,11 +115,6 @@ pub unsafe fn create_module(
|
||||||
let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
|
let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx);
|
||||||
|
|
||||||
let mut target_data_layout = sess.target.data_layout.clone();
|
let mut target_data_layout = sess.target.data_layout.clone();
|
||||||
if llvm_util::get_version() < (10, 0, 0)
|
|
||||||
&& (sess.target.arch == "x86" || sess.target.arch == "x86_64")
|
|
||||||
{
|
|
||||||
target_data_layout = strip_x86_address_spaces(target_data_layout);
|
|
||||||
}
|
|
||||||
if llvm_util::get_version() < (12, 0, 0) && sess.target.arch == "powerpc64" {
|
if llvm_util::get_version() < (12, 0, 0) && sess.target.arch == "powerpc64" {
|
||||||
target_data_layout = strip_powerpc64_vectors(target_data_layout);
|
target_data_layout = strip_powerpc64_vectors(target_data_layout);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,16 +88,6 @@ fn main() {
|
||||||
"riscv",
|
"riscv",
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut version_cmd = Command::new(&llvm_config);
|
|
||||||
version_cmd.arg("--version");
|
|
||||||
let version_output = output(&mut version_cmd);
|
|
||||||
let mut parts = version_output.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
|
||||||
let (major, _minor) = if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
|
|
||||||
(major, minor)
|
|
||||||
} else {
|
|
||||||
(8, 0)
|
|
||||||
};
|
|
||||||
|
|
||||||
let required_components = &[
|
let required_components = &[
|
||||||
"ipo",
|
"ipo",
|
||||||
"bitreader",
|
"bitreader",
|
||||||
|
@ -123,10 +113,6 @@ fn main() {
|
||||||
println!("cargo:rustc-cfg=llvm_component=\"{}\"", component);
|
println!("cargo:rustc-cfg=llvm_component=\"{}\"", component);
|
||||||
}
|
}
|
||||||
|
|
||||||
if major >= 9 {
|
|
||||||
println!("cargo:rustc-cfg=llvm_has_msp430_asm_parser");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Link in our own LLVM shims, compiled with the same flags as LLVM
|
// Link in our own LLVM shims, compiled with the same flags as LLVM
|
||||||
let mut cmd = Command::new(&llvm_config);
|
let mut cmd = Command::new(&llvm_config);
|
||||||
cmd.arg("--cxxflags");
|
cmd.arg("--cxxflags");
|
||||||
|
|
|
@ -91,11 +91,7 @@ extern "C" void LLVMRustDestroyArchive(LLVMRustArchiveRef RustArchive) {
|
||||||
extern "C" LLVMRustArchiveIteratorRef
|
extern "C" LLVMRustArchiveIteratorRef
|
||||||
LLVMRustArchiveIteratorNew(LLVMRustArchiveRef RustArchive) {
|
LLVMRustArchiveIteratorNew(LLVMRustArchiveRef RustArchive) {
|
||||||
Archive *Archive = RustArchive->getBinary();
|
Archive *Archive = RustArchive->getBinary();
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
std::unique_ptr<Error> Err = std::make_unique<Error>(Error::success());
|
std::unique_ptr<Error> Err = std::make_unique<Error>(Error::success());
|
||||||
#else
|
|
||||||
std::unique_ptr<Error> Err = llvm::make_unique<Error>(Error::success());
|
|
||||||
#endif
|
|
||||||
auto Cur = Archive->child_begin(*Err);
|
auto Cur = Archive->child_begin(*Err);
|
||||||
if (*Err) {
|
if (*Err) {
|
||||||
LLVMRustSetLastError(toString(std::move(*Err)).c_str());
|
LLVMRustSetLastError(toString(std::move(*Err)).c_str());
|
||||||
|
|
|
@ -65,13 +65,9 @@ extern "C" void LLVMInitializePasses() {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMTimeTraceProfilerInitialize() {
|
extern "C" void LLVMTimeTraceProfilerInitialize() {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
timeTraceProfilerInitialize(
|
timeTraceProfilerInitialize(
|
||||||
/* TimeTraceGranularity */ 0,
|
/* TimeTraceGranularity */ 0,
|
||||||
/* ProcName */ "rustc");
|
/* ProcName */ "rustc");
|
||||||
#else
|
|
||||||
timeTraceProfilerInitialize();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) {
|
extern "C" void LLVMTimeTraceProfilerFinish(const char* FileName) {
|
||||||
|
@ -596,7 +592,6 @@ enum class LLVMRustFileType {
|
||||||
ObjectFile,
|
ObjectFile,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
static CodeGenFileType fromRust(LLVMRustFileType Type) {
|
static CodeGenFileType fromRust(LLVMRustFileType Type) {
|
||||||
switch (Type) {
|
switch (Type) {
|
||||||
case LLVMRustFileType::AssemblyFile:
|
case LLVMRustFileType::AssemblyFile:
|
||||||
|
@ -607,18 +602,6 @@ static CodeGenFileType fromRust(LLVMRustFileType Type) {
|
||||||
report_fatal_error("Bad FileType.");
|
report_fatal_error("Bad FileType.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static TargetMachine::CodeGenFileType fromRust(LLVMRustFileType Type) {
|
|
||||||
switch (Type) {
|
|
||||||
case LLVMRustFileType::AssemblyFile:
|
|
||||||
return TargetMachine::CGFT_AssemblyFile;
|
|
||||||
case LLVMRustFileType::ObjectFile:
|
|
||||||
return TargetMachine::CGFT_ObjectFile;
|
|
||||||
default:
|
|
||||||
report_fatal_error("Bad FileType.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" LLVMRustResult
|
extern "C" LLVMRustResult
|
||||||
LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
|
LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
|
||||||
|
@ -868,13 +851,11 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
PipelineStartEPCallbacks.push_back(
|
PipelineStartEPCallbacks.push_back(
|
||||||
[Options](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
|
[Options](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
|
||||||
MPM.addPass(MemorySanitizerPass(Options));
|
MPM.addPass(MemorySanitizerPass(Options));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
OptimizerLastEPCallbacks.push_back(
|
OptimizerLastEPCallbacks.push_back(
|
||||||
[Options](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
|
[Options](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
|
||||||
FPM.addPass(MemorySanitizerPass(Options));
|
FPM.addPass(MemorySanitizerPass(Options));
|
||||||
|
@ -892,13 +873,11 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
PipelineStartEPCallbacks.push_back(
|
PipelineStartEPCallbacks.push_back(
|
||||||
[](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
|
[](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) {
|
||||||
MPM.addPass(ThreadSanitizerPass());
|
MPM.addPass(ThreadSanitizerPass());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
OptimizerLastEPCallbacks.push_back(
|
OptimizerLastEPCallbacks.push_back(
|
||||||
[](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
|
[](FunctionPassManager &FPM, PassBuilder::OptimizationLevel Level) {
|
||||||
FPM.addPass(ThreadSanitizerPass());
|
FPM.addPass(ThreadSanitizerPass());
|
||||||
|
@ -989,13 +968,11 @@ LLVMRustOptimizeWithNewPassManager(
|
||||||
|
|
||||||
MPM.addPass(AlwaysInlinerPass(EmitLifetimeMarkers));
|
MPM.addPass(AlwaysInlinerPass(EmitLifetimeMarkers));
|
||||||
|
|
||||||
# if LLVM_VERSION_GE(10, 0)
|
|
||||||
if (PGOOpt) {
|
if (PGOOpt) {
|
||||||
PB.addPGOInstrPassesForO0(
|
PB.addPGOInstrPassesForO0(
|
||||||
MPM, DebugPassManager, PGOOpt->Action == PGOOptions::IRInstr,
|
MPM, DebugPassManager, PGOOpt->Action == PGOOptions::IRInstr,
|
||||||
/*IsCS=*/false, PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);
|
/*IsCS=*/false, PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if LLVM_VERSION_GE(12, 0)
|
#if LLVM_VERSION_GE(12, 0)
|
||||||
|
@ -1366,11 +1343,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
int num_modules,
|
int num_modules,
|
||||||
const char **preserved_symbols,
|
const char **preserved_symbols,
|
||||||
int num_symbols) {
|
int num_symbols) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
auto Ret = std::make_unique<LLVMRustThinLTOData>();
|
auto Ret = std::make_unique<LLVMRustThinLTOData>();
|
||||||
#else
|
|
||||||
auto Ret = llvm::make_unique<LLVMRustThinLTOData>();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Load each module's summary and merge it into one combined index
|
// Load each module's summary and merge it into one combined index
|
||||||
for (int i = 0; i < num_modules; i++) {
|
for (int i = 0; i < num_modules; i++) {
|
||||||
|
@ -1463,7 +1436,6 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
ExportedGUIDs.insert(GUID);
|
ExportedGUIDs.insert(GUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) {
|
auto isExported = [&](StringRef ModuleIdentifier, ValueInfo VI) {
|
||||||
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
|
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
|
||||||
return (ExportList != Ret->ExportLists.end() &&
|
return (ExportList != Ret->ExportLists.end() &&
|
||||||
|
@ -1471,15 +1443,6 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
ExportedGUIDs.count(VI.getGUID());
|
ExportedGUIDs.count(VI.getGUID());
|
||||||
};
|
};
|
||||||
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported, isPrevailing);
|
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported, isPrevailing);
|
||||||
#else
|
|
||||||
auto isExported = [&](StringRef ModuleIdentifier, GlobalValue::GUID GUID) {
|
|
||||||
const auto &ExportList = Ret->ExportLists.find(ModuleIdentifier);
|
|
||||||
return (ExportList != Ret->ExportLists.end() &&
|
|
||||||
ExportList->second.count(GUID)) ||
|
|
||||||
ExportedGUIDs.count(GUID);
|
|
||||||
};
|
|
||||||
thinLTOInternalizeAndPromoteInIndex(Ret->Index, isExported);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return Ret.release();
|
return Ret.release();
|
||||||
}
|
}
|
||||||
|
@ -1636,11 +1599,7 @@ struct LLVMRustThinLTOBuffer {
|
||||||
|
|
||||||
extern "C" LLVMRustThinLTOBuffer*
|
extern "C" LLVMRustThinLTOBuffer*
|
||||||
LLVMRustThinLTOBufferCreate(LLVMModuleRef M) {
|
LLVMRustThinLTOBufferCreate(LLVMModuleRef M) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
auto Ret = std::make_unique<LLVMRustThinLTOBuffer>();
|
auto Ret = std::make_unique<LLVMRustThinLTOBuffer>();
|
||||||
#else
|
|
||||||
auto Ret = llvm::make_unique<LLVMRustThinLTOBuffer>();
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
raw_string_ostream OS(Ret->data);
|
raw_string_ostream OS(Ret->data);
|
||||||
{
|
{
|
||||||
|
|
|
@ -541,11 +541,6 @@ static DINode::DIFlags fromRust(LLVMRustDIFlags Flags) {
|
||||||
if (isSet(Flags & LLVMRustDIFlags::FlagAppleBlock)) {
|
if (isSet(Flags & LLVMRustDIFlags::FlagAppleBlock)) {
|
||||||
Result |= DINode::DIFlags::FlagAppleBlock;
|
Result |= DINode::DIFlags::FlagAppleBlock;
|
||||||
}
|
}
|
||||||
#if LLVM_VERSION_LT(10, 0)
|
|
||||||
if (isSet(Flags & LLVMRustDIFlags::FlagBlockByrefStruct)) {
|
|
||||||
Result |= DINode::DIFlags::FlagBlockByrefStruct;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (isSet(Flags & LLVMRustDIFlags::FlagVirtual)) {
|
if (isSet(Flags & LLVMRustDIFlags::FlagVirtual)) {
|
||||||
Result |= DINode::DIFlags::FlagVirtual;
|
Result |= DINode::DIFlags::FlagVirtual;
|
||||||
}
|
}
|
||||||
|
@ -910,9 +905,7 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
|
||||||
unwrapDI<DIDescriptor>(Context), StringRef(Name, NameLen),
|
unwrapDI<DIDescriptor>(Context), StringRef(Name, NameLen),
|
||||||
StringRef(LinkageName, LinkageNameLen),
|
StringRef(LinkageName, LinkageNameLen),
|
||||||
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
|
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
/* isDefined */ true,
|
/* isDefined */ true,
|
||||||
#endif
|
|
||||||
InitExpr, unwrapDIPtr<MDNode>(Decl),
|
InitExpr, unwrapDIPtr<MDNode>(Decl),
|
||||||
/* templateParams */ nullptr,
|
/* templateParams */ nullptr,
|
||||||
AlignInBits);
|
AlignInBits);
|
||||||
|
@ -1099,19 +1092,11 @@ inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
|
||||||
|
|
||||||
extern "C" size_t LLVMRustGetSectionName(LLVMSectionIteratorRef SI,
|
extern "C" size_t LLVMRustGetSectionName(LLVMSectionIteratorRef SI,
|
||||||
const char **Ptr) {
|
const char **Ptr) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
auto NameOrErr = (*unwrap(SI))->getName();
|
auto NameOrErr = (*unwrap(SI))->getName();
|
||||||
if (!NameOrErr)
|
if (!NameOrErr)
|
||||||
report_fatal_error(NameOrErr.takeError());
|
report_fatal_error(NameOrErr.takeError());
|
||||||
*Ptr = NameOrErr->data();
|
*Ptr = NameOrErr->data();
|
||||||
return NameOrErr->size();
|
return NameOrErr->size();
|
||||||
#else
|
|
||||||
StringRef Ret;
|
|
||||||
if (std::error_code EC = (*unwrap(SI))->getName(Ret))
|
|
||||||
report_fatal_error(EC.message());
|
|
||||||
*Ptr = Ret.data();
|
|
||||||
return Ret.size();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LLVMArrayType function does not support 64-bit ElementCount
|
// LLVMArrayType function does not support 64-bit ElementCount
|
||||||
|
@ -1450,47 +1435,28 @@ extern "C" LLVMValueRef LLVMRustBuildMemCpy(LLVMBuilderRef B,
|
||||||
LLVMValueRef Dst, unsigned DstAlign,
|
LLVMValueRef Dst, unsigned DstAlign,
|
||||||
LLVMValueRef Src, unsigned SrcAlign,
|
LLVMValueRef Src, unsigned SrcAlign,
|
||||||
LLVMValueRef Size, bool IsVolatile) {
|
LLVMValueRef Size, bool IsVolatile) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
return wrap(unwrap(B)->CreateMemCpy(
|
return wrap(unwrap(B)->CreateMemCpy(
|
||||||
unwrap(Dst), MaybeAlign(DstAlign),
|
unwrap(Dst), MaybeAlign(DstAlign),
|
||||||
unwrap(Src), MaybeAlign(SrcAlign),
|
unwrap(Src), MaybeAlign(SrcAlign),
|
||||||
unwrap(Size), IsVolatile));
|
unwrap(Size), IsVolatile));
|
||||||
#else
|
|
||||||
return wrap(unwrap(B)->CreateMemCpy(
|
|
||||||
unwrap(Dst), DstAlign,
|
|
||||||
unwrap(Src), SrcAlign,
|
|
||||||
unwrap(Size), IsVolatile));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B,
|
extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B,
|
||||||
LLVMValueRef Dst, unsigned DstAlign,
|
LLVMValueRef Dst, unsigned DstAlign,
|
||||||
LLVMValueRef Src, unsigned SrcAlign,
|
LLVMValueRef Src, unsigned SrcAlign,
|
||||||
LLVMValueRef Size, bool IsVolatile) {
|
LLVMValueRef Size, bool IsVolatile) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
return wrap(unwrap(B)->CreateMemMove(
|
return wrap(unwrap(B)->CreateMemMove(
|
||||||
unwrap(Dst), MaybeAlign(DstAlign),
|
unwrap(Dst), MaybeAlign(DstAlign),
|
||||||
unwrap(Src), MaybeAlign(SrcAlign),
|
unwrap(Src), MaybeAlign(SrcAlign),
|
||||||
unwrap(Size), IsVolatile));
|
unwrap(Size), IsVolatile));
|
||||||
#else
|
|
||||||
return wrap(unwrap(B)->CreateMemMove(
|
|
||||||
unwrap(Dst), DstAlign,
|
|
||||||
unwrap(Src), SrcAlign,
|
|
||||||
unwrap(Size), IsVolatile));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
|
extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
|
||||||
LLVMValueRef Dst, unsigned DstAlign,
|
LLVMValueRef Dst, unsigned DstAlign,
|
||||||
LLVMValueRef Val,
|
LLVMValueRef Val,
|
||||||
LLVMValueRef Size, bool IsVolatile) {
|
LLVMValueRef Size, bool IsVolatile) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
return wrap(unwrap(B)->CreateMemSet(
|
return wrap(unwrap(B)->CreateMemSet(
|
||||||
unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
|
unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
|
||||||
#else
|
|
||||||
return wrap(unwrap(B)->CreateMemSet(
|
|
||||||
unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMValueRef
|
extern "C" LLVMValueRef
|
||||||
|
@ -1676,11 +1642,7 @@ struct LLVMRustModuleBuffer {
|
||||||
|
|
||||||
extern "C" LLVMRustModuleBuffer*
|
extern "C" LLVMRustModuleBuffer*
|
||||||
LLVMRustModuleBufferCreate(LLVMModuleRef M) {
|
LLVMRustModuleBufferCreate(LLVMModuleRef M) {
|
||||||
#if LLVM_VERSION_GE(10, 0)
|
|
||||||
auto Ret = std::make_unique<LLVMRustModuleBuffer>();
|
auto Ret = std::make_unique<LLVMRustModuleBuffer>();
|
||||||
#else
|
|
||||||
auto Ret = llvm::make_unique<LLVMRustModuleBuffer>();
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
raw_string_ostream OS(Ret->data);
|
raw_string_ostream OS(Ret->data);
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,10 +125,7 @@ pub fn initialize_available_targets() {
|
||||||
LLVMInitializeMSP430TargetInfo,
|
LLVMInitializeMSP430TargetInfo,
|
||||||
LLVMInitializeMSP430Target,
|
LLVMInitializeMSP430Target,
|
||||||
LLVMInitializeMSP430TargetMC,
|
LLVMInitializeMSP430TargetMC,
|
||||||
LLVMInitializeMSP430AsmPrinter
|
LLVMInitializeMSP430AsmPrinter,
|
||||||
);
|
|
||||||
init_target!(
|
|
||||||
all(llvm_component = "msp430", llvm_has_msp430_asm_parser),
|
|
||||||
LLVMInitializeMSP430AsmParser
|
LLVMInitializeMSP430AsmParser
|
||||||
);
|
);
|
||||||
init_target!(
|
init_target!(
|
||||||
|
|
|
@ -62,10 +62,9 @@ mod fpu_precision {
|
||||||
// any `u16`
|
// any `u16`
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!(
|
asm!(
|
||||||
"fldcw ({})",
|
"fldcw word ptr [{}]",
|
||||||
in(reg) &cw,
|
in(reg) &cw,
|
||||||
// FIXME: We are using ATT syntax to support LLVM 8 and LLVM 9.
|
options(nostack),
|
||||||
options(att_syntax, nostack),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,10 +86,9 @@ mod fpu_precision {
|
||||||
// any `u16`
|
// any `u16`
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!(
|
asm!(
|
||||||
"fnstcw ({})",
|
"fnstcw word ptr [{}]",
|
||||||
in(reg) &mut cw,
|
in(reg) &mut cw,
|
||||||
// FIXME: We are using ATT syntax to support LLVM 8 and LLVM 9.
|
options(nostack),
|
||||||
options(att_syntax, nostack),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,11 @@ fn main() {
|
||||||
"InstrProfilingPlatformLinux.c",
|
"InstrProfilingPlatformLinux.c",
|
||||||
"InstrProfilingPlatformOther.c",
|
"InstrProfilingPlatformOther.c",
|
||||||
"InstrProfilingPlatformWindows.c",
|
"InstrProfilingPlatformWindows.c",
|
||||||
|
"InstrProfilingRuntime.cpp",
|
||||||
"InstrProfilingUtil.c",
|
"InstrProfilingUtil.c",
|
||||||
"InstrProfilingValue.c",
|
"InstrProfilingValue.c",
|
||||||
"InstrProfilingVersionVar.c",
|
"InstrProfilingVersionVar.c",
|
||||||
"InstrProfilingWriter.c",
|
"InstrProfilingWriter.c",
|
||||||
// This file was renamed in LLVM 10.
|
|
||||||
"InstrProfilingRuntime.cc",
|
|
||||||
"InstrProfilingRuntime.cpp",
|
|
||||||
// These files were added in LLVM 11.
|
// These files were added in LLVM 11.
|
||||||
"InstrProfilingInternal.c",
|
"InstrProfilingInternal.c",
|
||||||
"InstrProfilingBiasVar.c",
|
"InstrProfilingBiasVar.c",
|
||||||
|
|
|
@ -36,10 +36,9 @@ pub fn image_base() -> u64 {
|
||||||
let base: u64;
|
let base: u64;
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!(
|
asm!(
|
||||||
"lea IMAGE_BASE(%rip), {}",
|
"lea {}, qword ptr [rip + IMAGE_BASE]",
|
||||||
lateout(reg) base,
|
lateout(reg) base,
|
||||||
// NOTE(#76738): ATT syntax is used to support LLVM 8 and 9.
|
options(nostack, preserves_flags, nomem, pure),
|
||||||
options(att_syntax, nostack, preserves_flags, nomem, pure),
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
base
|
base
|
||||||
|
|
|
@ -36,8 +36,7 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
|
||||||
inlateout("eax") ENCLU_EGETKEY => error,
|
inlateout("eax") ENCLU_EGETKEY => error,
|
||||||
in("rbx") request,
|
in("rbx") request,
|
||||||
in("rcx") out.as_mut_ptr(),
|
in("rcx") out.as_mut_ptr(),
|
||||||
// NOTE(#76738): ATT syntax is used to support LLVM 8 and 9.
|
options(nostack),
|
||||||
options(att_syntax, nostack),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
match error {
|
match error {
|
||||||
|
@ -66,8 +65,7 @@ pub fn ereport(
|
||||||
in("rbx") targetinfo,
|
in("rbx") targetinfo,
|
||||||
in("rcx") reportdata,
|
in("rcx") reportdata,
|
||||||
in("rdx") report.as_mut_ptr(),
|
in("rdx") report.as_mut_ptr(),
|
||||||
// NOTE(#76738): ATT syntax is used to support LLVM 8 and 9.
|
options(preserves_flags, nostack),
|
||||||
options(att_syntax, preserves_flags, nostack),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
report.assume_init()
|
report.assume_init()
|
||||||
|
|
|
@ -347,11 +347,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
|
||||||
let version = output(cmd.arg("--version"));
|
let version = output(cmd.arg("--version"));
|
||||||
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
||||||
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
||||||
if major >= 9 {
|
if major >= 10 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!("\n\nbad LLVM version: {}, need >=9.0\n\n", version)
|
panic!("\n\nbad LLVM version: {}, need >=10.0\n\n", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_cmake(
|
fn configure_cmake(
|
||||||
|
|
|
@ -13,8 +13,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
cmake \
|
cmake \
|
||||||
sudo \
|
sudo \
|
||||||
gdb \
|
gdb \
|
||||||
llvm-9-tools \
|
llvm-10-tools \
|
||||||
llvm-9-dev \
|
llvm-10-dev \
|
||||||
libedit-dev \
|
libedit-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
|
@ -28,7 +28,7 @@ RUN sh /scripts/sccache.sh
|
||||||
# using llvm-link-shared due to libffi issues -- see #34486
|
# using llvm-link-shared due to libffi issues -- see #34486
|
||||||
ENV RUST_CONFIGURE_ARGS \
|
ENV RUST_CONFIGURE_ARGS \
|
||||||
--build=x86_64-unknown-linux-gnu \
|
--build=x86_64-unknown-linux-gnu \
|
||||||
--llvm-root=/usr/lib/llvm-9 \
|
--llvm-root=/usr/lib/llvm-10 \
|
||||||
--enable-llvm-link-shared \
|
--enable-llvm-link-shared \
|
||||||
--set rust.thin-lto-import-instr-limit=10
|
--set rust.thin-lto-import-instr-limit=10
|
||||||
|
|
|
@ -280,7 +280,7 @@ jobs:
|
||||||
- name: mingw-check
|
- name: mingw-check
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-9
|
- name: x86_64-gnu-llvm-10
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
|
@ -412,7 +412,7 @@ jobs:
|
||||||
- name: x86_64-gnu-distcheck
|
- name: x86_64-gnu-distcheck
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-9
|
- name: x86_64-gnu-llvm-10
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
// min-llvm-version 8.0
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
||||||
// ignore-emscripten
|
// ignore-emscripten
|
||||||
// min-system-llvm-version: 9.0
|
|
||||||
|
|
||||||
// Test that the simd_reduce_{op} intrinsics produce the correct results.
|
// Test that the simd_reduce_{op} intrinsics produce the correct results.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue