mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Update the minimum external LLVM to 15
This commit is contained in:
parent
9339f446a5
commit
190ded8443
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: mingw-check-tidy
|
- name: mingw-check-tidy
|
||||||
os: ubuntu-20.04-16core-64gb
|
os: ubuntu-20.04-16core-64gb
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-llvm-14
|
- name: x86_64-gnu-llvm-15
|
||||||
os: ubuntu-20.04-16core-64gb
|
os: ubuntu-20.04-16core-64gb
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
@ -293,10 +293,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
os: ubuntu-20.04-8core-32gb
|
os: ubuntu-20.04-8core-32gb
|
||||||
- name: x86_64-gnu-llvm-14
|
|
||||||
env:
|
|
||||||
RUST_BACKTRACE: 1
|
|
||||||
os: ubuntu-20.04-8core-32gb
|
|
||||||
- name: x86_64-gnu-nopt
|
- name: x86_64-gnu-nopt
|
||||||
os: ubuntu-20.04-4core-16gb
|
os: ubuntu-20.04-4core-16gb
|
||||||
env: {}
|
env: {}
|
||||||
|
@ -363,50 +363,44 @@ pub fn from_fn_attrs<'ll, 'tcx>(
|
|||||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR)
|
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR)
|
||||||
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR_ZEROED)
|
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR_ZEROED)
|
||||||
{
|
{
|
||||||
if llvm_util::get_version() >= (15, 0, 0) {
|
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
// apply to argument place instead of function
|
||||||
// apply to argument place instead of function
|
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
|
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
|
||||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
|
let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
|
||||||
let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
|
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
|
||||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
|
flags |= AllocKindFlags::Uninitialized;
|
||||||
flags |= AllocKindFlags::Uninitialized;
|
} else {
|
||||||
} else {
|
flags |= AllocKindFlags::Zeroed;
|
||||||
flags |= AllocKindFlags::Zeroed;
|
|
||||||
}
|
|
||||||
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
|
|
||||||
}
|
}
|
||||||
|
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
|
||||||
// apply to return place instead of function (unlike all other attributes applied in this function)
|
// apply to return place instead of function (unlike all other attributes applied in this function)
|
||||||
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
||||||
}
|
}
|
||||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::REALLOCATOR) {
|
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::REALLOCATOR) {
|
||||||
if llvm_util::get_version() >= (15, 0, 0) {
|
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
to_add.push(llvm::CreateAllocKindAttr(
|
||||||
to_add.push(llvm::CreateAllocKindAttr(
|
cx.llcx,
|
||||||
cx.llcx,
|
AllocKindFlags::Realloc | AllocKindFlags::Aligned,
|
||||||
AllocKindFlags::Realloc | AllocKindFlags::Aligned,
|
));
|
||||||
));
|
// applies to argument place instead of function place
|
||||||
// applies to argument place instead of function place
|
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
// apply to argument place instead of function
|
||||||
// apply to argument place instead of function
|
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
|
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
|
||||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
|
|
||||||
}
|
|
||||||
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
||||||
}
|
}
|
||||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::DEALLOCATOR) {
|
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::DEALLOCATOR) {
|
||||||
if llvm_util::get_version() >= (15, 0, 0) {
|
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
|
||||||
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
|
// applies to argument place instead of function place
|
||||||
// applies to argument place instead of function place
|
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::CMSE_NONSECURE_ENTRY) {
|
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::CMSE_NONSECURE_ENTRY) {
|
||||||
to_add.push(llvm::CreateAttrString(cx.llcx, "cmse_nonsecure_entry"));
|
to_add.push(llvm::CreateAttrString(cx.llcx, "cmse_nonsecure_entry"));
|
||||||
|
@ -507,8 +507,6 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
|
|||||||
.features
|
.features
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(|v| !v.is_empty() && backend_feature_name(v).is_some())
|
.filter(|v| !v.is_empty() && backend_feature_name(v).is_some())
|
||||||
// Drop +atomics-32 feature introduced in LLVM 15.
|
|
||||||
.filter(|v| *v != "+atomics-32" || get_version() >= (15, 0, 0))
|
|
||||||
.map(String::from),
|
.map(String::from),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -92,10 +92,8 @@ enum LLVMRustAttribute {
|
|||||||
NoCfCheck = 35,
|
NoCfCheck = 35,
|
||||||
ShadowCallStack = 36,
|
ShadowCallStack = 36,
|
||||||
AllocSize = 37,
|
AllocSize = 37,
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
AllocatedPointer = 38,
|
AllocatedPointer = 38,
|
||||||
AllocAlign = 39,
|
AllocAlign = 39,
|
||||||
#endif
|
|
||||||
SanitizeSafeStack = 40,
|
SanitizeSafeStack = 40,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -801,9 +801,6 @@ LLVMRustOptimize(
|
|||||||
OptimizerLastEPCallbacks.push_back(
|
OptimizerLastEPCallbacks.push_back(
|
||||||
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
||||||
auto CompileKernel = SanitizerOptions->SanitizeKernelAddress;
|
auto CompileKernel = SanitizerOptions->SanitizeKernelAddress;
|
||||||
#if LLVM_VERSION_LT(15, 0)
|
|
||||||
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
|
||||||
#endif
|
|
||||||
AddressSanitizerOptions opts = AddressSanitizerOptions{
|
AddressSanitizerOptions opts = AddressSanitizerOptions{
|
||||||
CompileKernel,
|
CompileKernel,
|
||||||
SanitizerOptions->SanitizeAddressRecover
|
SanitizerOptions->SanitizeAddressRecover
|
||||||
|
@ -277,12 +277,10 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
|||||||
return Attribute::ShadowCallStack;
|
return Attribute::ShadowCallStack;
|
||||||
case AllocSize:
|
case AllocSize:
|
||||||
return Attribute::AllocSize;
|
return Attribute::AllocSize;
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
case AllocatedPointer:
|
case AllocatedPointer:
|
||||||
return Attribute::AllocatedPointer;
|
return Attribute::AllocatedPointer;
|
||||||
case AllocAlign:
|
case AllocAlign:
|
||||||
return Attribute::AllocAlign;
|
return Attribute::AllocAlign;
|
||||||
#endif
|
|
||||||
case SanitizeSafeStack:
|
case SanitizeSafeStack:
|
||||||
return Attribute::SafeStack;
|
return Attribute::SafeStack;
|
||||||
}
|
}
|
||||||
@ -340,20 +338,12 @@ extern "C" LLVMAttributeRef LLVMRustCreateStructRetAttr(LLVMContextRef C, LLVMTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMAttributeRef LLVMRustCreateElementTypeAttr(LLVMContextRef C, LLVMTypeRef Ty) {
|
extern "C" LLVMAttributeRef LLVMRustCreateElementTypeAttr(LLVMContextRef C, LLVMTypeRef Ty) {
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
return wrap(Attribute::get(*unwrap(C), Attribute::ElementType, unwrap(Ty)));
|
return wrap(Attribute::get(*unwrap(C), Attribute::ElementType, unwrap(Ty)));
|
||||||
#else
|
|
||||||
report_fatal_error("Should not be needed on LLVM < 15");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMAttributeRef LLVMRustCreateUWTableAttr(LLVMContextRef C, bool Async) {
|
extern "C" LLVMAttributeRef LLVMRustCreateUWTableAttr(LLVMContextRef C, bool Async) {
|
||||||
#if LLVM_VERSION_LT(15, 0)
|
|
||||||
return wrap(Attribute::get(*unwrap(C), Attribute::UWTable));
|
|
||||||
#else
|
|
||||||
return wrap(Attribute::getWithUWTableKind(
|
return wrap(Attribute::getWithUWTableKind(
|
||||||
*unwrap(C), Async ? UWTableKind::Async : UWTableKind::Sync));
|
*unwrap(C), Async ? UWTableKind::Async : UWTableKind::Sync));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32_t ElementSizeArg) {
|
extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32_t ElementSizeArg) {
|
||||||
@ -366,8 +356,6 @@ extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
|
|
||||||
// These values **must** match ffi::AllocKindFlags.
|
// These values **must** match ffi::AllocKindFlags.
|
||||||
// It _happens_ to match the LLVM values of llvm::AllocFnKind,
|
// It _happens_ to match the LLVM values of llvm::AllocFnKind,
|
||||||
// but that's happenstance and we do explicit conversions before
|
// but that's happenstance and we do explicit conversions before
|
||||||
@ -411,16 +399,10 @@ static llvm::AllocFnKind allocKindFromRust(LLVMRustAllocKindFlags F) {
|
|||||||
}
|
}
|
||||||
return AFK;
|
return AFK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" LLVMAttributeRef LLVMRustCreateAllocKindAttr(LLVMContextRef C, uint64_t AllocKindArg) {
|
extern "C" LLVMAttributeRef LLVMRustCreateAllocKindAttr(LLVMContextRef C, uint64_t AllocKindArg) {
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
return wrap(Attribute::get(*unwrap(C), Attribute::AllocKind,
|
return wrap(Attribute::get(*unwrap(C), Attribute::AllocKind,
|
||||||
static_cast<uint64_t>(allocKindFromRust(static_cast<LLVMRustAllocKindFlags>(AllocKindArg)))));
|
static_cast<uint64_t>(allocKindFromRust(static_cast<LLVMRustAllocKindFlags>(AllocKindArg)))));
|
||||||
#else
|
|
||||||
report_fatal_error(
|
|
||||||
"allockind attributes are new in LLVM 15 and should not be used on older LLVMs");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simplified representation of `MemoryEffects` across the FFI boundary.
|
// Simplified representation of `MemoryEffects` across the FFI boundary.
|
||||||
@ -517,14 +499,9 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
|
|||||||
|
|
||||||
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
|
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
|
||||||
size_t ConstraintsLen) {
|
size_t ConstraintsLen) {
|
||||||
#if LLVM_VERSION_LT(15, 0)
|
|
||||||
return InlineAsm::Verify(unwrap<FunctionType>(Ty),
|
|
||||||
StringRef(Constraints, ConstraintsLen));
|
|
||||||
#else
|
|
||||||
// llvm::Error converts to true if it is an error.
|
// llvm::Error converts to true if it is an error.
|
||||||
return !llvm::errorToBool(InlineAsm::verify(
|
return !llvm::errorToBool(InlineAsm::verify(
|
||||||
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
|
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef DIBuilder *LLVMRustDIBuilderRef;
|
typedef DIBuilder *LLVMRustDIBuilderRef;
|
||||||
@ -1649,19 +1626,11 @@ extern "C" bool LLVMRustConstInt128Get(LLVMValueRef CV, bool sext, uint64_t *hig
|
|||||||
auto C = unwrap<llvm::ConstantInt>(CV);
|
auto C = unwrap<llvm::ConstantInt>(CV);
|
||||||
if (C->getBitWidth() > 128) { return false; }
|
if (C->getBitWidth() > 128) { return false; }
|
||||||
APInt AP;
|
APInt AP;
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
if (sext) {
|
if (sext) {
|
||||||
AP = C->getValue().sext(128);
|
AP = C->getValue().sext(128);
|
||||||
} else {
|
} else {
|
||||||
AP = C->getValue().zext(128);
|
AP = C->getValue().zext(128);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (sext) {
|
|
||||||
AP = C->getValue().sextOrSelf(128);
|
|
||||||
} else {
|
|
||||||
AP = C->getValue().zextOrSelf(128);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*low = AP.getLoBits(64).getZExtValue();
|
*low = AP.getLoBits(64).getZExtValue();
|
||||||
*high = AP.getHiBits(64).getZExtValue();
|
*high = AP.getHiBits(64).getZExtValue();
|
||||||
return true;
|
return true;
|
||||||
@ -2037,16 +2006,7 @@ extern "C" void LLVMRustGetMangledName(LLVMValueRef V, RustStringRef Str) {
|
|||||||
Mangler().getNameWithPrefix(OS, GV, true);
|
Mangler().getNameWithPrefix(OS, GV, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// LLVMGetAggregateElement was added in LLVM 15. For earlier LLVM versions just
|
|
||||||
// use its implementation.
|
|
||||||
#if LLVM_VERSION_LT(15, 0)
|
|
||||||
extern "C" LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx) {
|
|
||||||
return wrap(unwrap<Constant>(C)->getAggregateElement(Idx));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
|
extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
|
||||||
#if LLVM_VERSION_GE(15, 0)
|
|
||||||
auto *CB = unwrap<CallBase>(CallSite);
|
auto *CB = unwrap<CallBase>(CallSite);
|
||||||
switch (CB->getIntrinsicID()) {
|
switch (CB->getIntrinsicID()) {
|
||||||
case Intrinsic::arm_ldrex:
|
case Intrinsic::arm_ldrex:
|
||||||
@ -2054,7 +2014,6 @@ extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
|
|||||||
case Intrinsic::arm_strex:
|
case Intrinsic::arm_strex:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,11 +525,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 >= 14 {
|
if major >= 15 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!("\n\nbad LLVM version: {}, need >=14.0\n\n", version)
|
panic!("\n\nbad LLVM version: {}, need >=15.0\n\n", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_cmake(
|
fn configure_cmake(
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
g++ \
|
|
||||||
gcc-multilib \
|
|
||||||
make \
|
|
||||||
ninja-build \
|
|
||||||
file \
|
|
||||||
curl \
|
|
||||||
ca-certificates \
|
|
||||||
python3.11 \
|
|
||||||
git \
|
|
||||||
cmake \
|
|
||||||
sudo \
|
|
||||||
gdb \
|
|
||||||
llvm-14-tools \
|
|
||||||
llvm-14-dev \
|
|
||||||
libedit-dev \
|
|
||||||
libssl-dev \
|
|
||||||
pkg-config \
|
|
||||||
zlib1g-dev \
|
|
||||||
xz-utils \
|
|
||||||
nodejs \
|
|
||||||
mingw-w64 \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install powershell (universal package) so we can test x.ps1 on Linux
|
|
||||||
RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
|
|
||||||
dpkg -i powershell.deb && \
|
|
||||||
rm -f powershell.deb
|
|
||||||
|
|
||||||
COPY scripts/sccache.sh /scripts/
|
|
||||||
RUN sh /scripts/sccache.sh
|
|
||||||
|
|
||||||
# We are disabling CI LLVM since this builder is intentionally using a host
|
|
||||||
# LLVM, rather than the typical src/llvm-project LLVM.
|
|
||||||
ENV NO_DOWNLOAD_CI_LLVM 1
|
|
||||||
|
|
||||||
# This is not the latest LLVM version, so some components required by tests may
|
|
||||||
# be missing.
|
|
||||||
ENV IS_NOT_LATEST_LLVM 1
|
|
||||||
|
|
||||||
# Using llvm-link-shared due to libffi issues -- see #34486
|
|
||||||
ENV RUST_CONFIGURE_ARGS \
|
|
||||||
--build=x86_64-unknown-linux-gnu \
|
|
||||||
--llvm-root=/usr/lib/llvm-14 \
|
|
||||||
--enable-llvm-link-shared \
|
|
||||||
--set rust.thin-lto-import-instr-limit=10
|
|
||||||
|
|
||||||
COPY host-x86_64/x86_64-gnu-llvm-14/script.sh /tmp/
|
|
||||||
|
|
||||||
ENV SCRIPT /tmp/script.sh
|
|
@ -1,4 +1,4 @@
|
|||||||
FROM ubuntu:22.10
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
file \
|
file \
|
||||||
curl \
|
curl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
python3 \
|
python3.11 \
|
||||||
git \
|
git \
|
||||||
cmake \
|
cmake \
|
||||||
sudo \
|
sudo \
|
||||||
@ -49,20 +49,6 @@ ENV RUST_CONFIGURE_ARGS \
|
|||||||
--enable-llvm-link-shared \
|
--enable-llvm-link-shared \
|
||||||
--set rust.thin-lto-import-instr-limit=10
|
--set rust.thin-lto-import-instr-limit=10
|
||||||
|
|
||||||
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
|
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
||||||
ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
|
|
||||||
# Run the `mir-opt` tests again but this time for a 32-bit target.
|
ENV SCRIPT /tmp/script.sh
|
||||||
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
|
|
||||||
# both 32-bit and 64-bit outputs updated by the PR author, before
|
|
||||||
# the PR is approved and tested for merging.
|
|
||||||
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
|
|
||||||
# despite having different output on 32-bit vs 64-bit targets.
|
|
||||||
../x --stage 2 test tests/mir-opt \
|
|
||||||
--host='' --target=i686-unknown-linux-gnu && \
|
|
||||||
# Run the UI test suite again, but in `--pass=check` mode
|
|
||||||
#
|
|
||||||
# This is intended to make sure that both `--pass=check` continues to
|
|
||||||
# work.
|
|
||||||
#
|
|
||||||
../x.ps1 --stage 2 test tests/ui --pass=check \
|
|
||||||
--host='' --target=i686-unknown-linux-gnu
|
|
||||||
|
@ -45,20 +45,6 @@ ENV RUST_CONFIGURE_ARGS \
|
|||||||
--enable-llvm-link-shared \
|
--enable-llvm-link-shared \
|
||||||
--set rust.thin-lto-import-instr-limit=10
|
--set rust.thin-lto-import-instr-limit=10
|
||||||
|
|
||||||
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
|
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
||||||
ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
|
|
||||||
# Run the `mir-opt` tests again but this time for a 32-bit target.
|
ENV SCRIPT /tmp/script.sh
|
||||||
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
|
|
||||||
# both 32-bit and 64-bit outputs updated by the PR author, before
|
|
||||||
# the PR is approved and tested for merging.
|
|
||||||
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
|
|
||||||
# despite having different output on 32-bit vs 64-bit targets.
|
|
||||||
../x --stage 2 test tests/mir-opt \
|
|
||||||
--host='' --target=i686-unknown-linux-gnu && \
|
|
||||||
# Run the UI test suite again, but in `--pass=check` mode
|
|
||||||
#
|
|
||||||
# This is intended to make sure that both `--pass=check` continues to
|
|
||||||
# work.
|
|
||||||
#
|
|
||||||
../x.ps1 --stage 2 test tests/ui --pass=check \
|
|
||||||
--host='' --target=i686-unknown-linux-gnu
|
|
||||||
|
@ -323,7 +323,7 @@ jobs:
|
|||||||
- name: mingw-check-tidy
|
- name: mingw-check-tidy
|
||||||
<<: *job-linux-16c
|
<<: *job-linux-16c
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-14
|
- name: x86_64-gnu-llvm-15
|
||||||
<<: *job-linux-16c
|
<<: *job-linux-16c
|
||||||
|
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
@ -469,11 +469,6 @@ jobs:
|
|||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
<<: *job-linux-8c
|
<<: *job-linux-8c
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-14
|
|
||||||
env:
|
|
||||||
RUST_BACKTRACE: 1
|
|
||||||
<<: *job-linux-8c
|
|
||||||
|
|
||||||
- name: x86_64-gnu-nopt
|
- name: x86_64-gnu-nopt
|
||||||
<<: *job-linux-4c
|
<<: *job-linux-4c
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// assembly-output: emit-asm
|
// assembly-output: emit-asm
|
||||||
// min-llvm-version: 15.0
|
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
// ignore-sgx
|
// ignore-sgx
|
||||||
// revisions: opt-speed opt-size
|
// revisions: opt-speed opt-size
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
// [LIN] only-linux
|
// [LIN] only-linux
|
||||||
// assembly-output: emit-asm
|
// assembly-output: emit-asm
|
||||||
// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
|
// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
|
||||||
// min-llvm-version: 14
|
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
// ignore-sgx
|
// ignore-sgx
|
||||||
// ignore-debug
|
// ignore-debug
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// compile-flags: -Copt-level=1
|
// compile-flags: -Copt-level=1
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
// ignore-sgx
|
// ignore-sgx
|
||||||
// min-llvm-version: 15.0
|
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
|
||||||
// CHECK-LABEL: old_style
|
// CHECK-LABEL: old_style
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -C opt-level=3 -C no-prepopulate-passes
|
// compile-flags: -C opt-level=3 -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (for opaque pointers)
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version: 15.0 (because we're using opaque pointers)
|
|
||||||
// ignore-debug (debug assertions in `slice::from_raw_parts` block optimizations)
|
// ignore-debug (debug assertions in `slice::from_raw_parts` block optimizations)
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O -C no-prepopulate-passes
|
// compile-flags: -O -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (for opaque pointers)
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version: 15.0
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
use std::mem::MaybeUninit;
|
use std::mem::MaybeUninit;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -C opt-level=1 -Z merge-functions=disabled
|
// compile-flags: -C opt-level=1 -Z merge-functions=disabled
|
||||||
// min-llvm-version: 15.0
|
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
// in the operators for such a type all optimize away.
|
// in the operators for such a type all optimize away.
|
||||||
|
|
||||||
// compile-flags: -C opt-level=1
|
// compile-flags: -C opt-level=1
|
||||||
// min-llvm-version: 15.0
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (for opaque pointers)
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O -C no-prepopulate-passes
|
// compile-flags: -O -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (because we're using opaque pointers)
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// [OPT] compile-flags: -C opt-level=3 -C no-prepopulate-passes
|
// [OPT] compile-flags: -C opt-level=3 -C no-prepopulate-passes
|
||||||
// [DBG] compile-flags: -C opt-level=0 -C no-prepopulate-passes
|
// [DBG] compile-flags: -C opt-level=0 -C no-prepopulate-passes
|
||||||
// only-64bit (so I don't need to worry about usize)
|
// only-64bit (so I don't need to worry about usize)
|
||||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// compile-flags: -O -C no-prepopulate-passes
|
// compile-flags: -O -C no-prepopulate-passes
|
||||||
// only-x86_64 (it's using arch-specific types)
|
// only-x86_64 (it's using arch-specific types)
|
||||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// compile-flags: -O -C no-prepopulate-passes
|
// compile-flags: -O -C no-prepopulate-passes
|
||||||
// only-64bit (so I don't need to worry about usize)
|
// only-64bit (so I don't need to worry about usize)
|
||||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes -Zmir-enable-passes=-ScalarReplacementOfAggregates
|
// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes -Zmir-enable-passes=-ScalarReplacementOfAggregates
|
||||||
// MIR SROA will decompose the closure
|
// MIR SROA will decompose the closure
|
||||||
// min-llvm-version: 15.0 # this test uses opaque pointer notation
|
|
||||||
#![feature(stmt_expr_attributes)]
|
#![feature(stmt_expr_attributes)]
|
||||||
|
|
||||||
pub struct S([usize; 8]);
|
pub struct S([usize; 8]);
|
||||||
@ -16,8 +15,8 @@ pub fn outer_function(x: S, y: S) -> usize {
|
|||||||
// Check that we do not attempt to load from the spilled arg before it is assigned to
|
// Check that we do not attempt to load from the spilled arg before it is assigned to
|
||||||
// when generating debuginfo.
|
// when generating debuginfo.
|
||||||
// CHECK-LABEL: @outer_function
|
// CHECK-LABEL: @outer_function
|
||||||
// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:10:23: 10:25]"
|
// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
|
||||||
// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:10:23: 10:25]", ptr [[spill]]
|
// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
|
||||||
// CHECK-NOT: [[load:%.*]] = load ptr, ptr
|
// CHECK-NOT: [[load:%.*]] = load ptr, ptr
|
||||||
// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
|
// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
|
||||||
// CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
|
// CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// min-llvm-version: 15.0.0
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// min-llvm-version: 15.0
|
|
||||||
// only-64bit llvm appears to use stores instead of memset on 32bit
|
// only-64bit llvm appears to use stores instead of memset on 32bit
|
||||||
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
|
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// min-llvm-version: 15.0
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
// in some situations, see https://github.com/rust-lang/rust/issues/96497#issuecomment-1112865218
|
// in some situations, see https://github.com/rust-lang/rust/issues/96497#issuecomment-1112865218
|
||||||
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version: 15.0
|
|
||||||
|
|
||||||
#![crate_type="lib"]
|
#![crate_type="lib"]
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// min-llvm-version: 15.0.0
|
|
||||||
// ignore-debug: The debug assertions get in the way
|
// ignore-debug: The debug assertions get in the way
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O -C no-prepopulate-passes
|
// compile-flags: -O -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (for opaque pointers)
|
|
||||||
// only-x86_64 (to not worry about usize differing)
|
// only-x86_64 (to not worry about usize differing)
|
||||||
// ignore-debug (the debug assertions get in the way)
|
// ignore-debug (the debug assertions get in the way)
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// only-64bit (because we're using [ui]size)
|
// only-64bit (because we're using [ui]size)
|
||||||
// ignore-debug (because the assertions get in the way)
|
// ignore-debug (because the assertions get in the way)
|
||||||
// min-llvm-version: 15.0 (because this is a relatively new instcombine)
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(slice_from_ptr_range)]
|
#![feature(slice_from_ptr_range)]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O -Z merge-functions=disabled
|
// compile-flags: -O -Z merge-functions=disabled
|
||||||
// min-llvm-version: 15.0 # this test uses `ptr`s
|
|
||||||
// ignore-debug
|
// ignore-debug
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -C opt-level=0 -C no-prepopulate-passes
|
// compile-flags: -C opt-level=0 -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 # this test assumes `ptr`s and thus no `pointercast`s
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// min-llvm-version: 15.0
|
|
||||||
// compile-flags: -O -Z merge-functions=disabled --edition=2021
|
// compile-flags: -O -Z merge-functions=disabled --edition=2021
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version: 15.0 (LLVM 13 in CI does this differently from submodule LLVM)
|
|
||||||
// ignore-debug (because unchecked is checked in debug)
|
// ignore-debug (because unchecked is checked in debug)
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
// min-llvm-version: 15.0 (for opaque pointers)
|
|
||||||
|
|
||||||
// Check that we use undef (and not zero) for uninitialized bytes in constants.
|
// Check that we use undef (and not zero) for uninitialized bytes in constants.
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// compile-flags: -O -Z merge-functions=disabled
|
// compile-flags: -O -Z merge-functions=disabled
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
// ignore-debug
|
// ignore-debug
|
||||||
// min-llvm-version: 15.0
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// build-pass
|
// build-pass
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version: 14.0.5
|
|
||||||
// needs-asm-support
|
// needs-asm-support
|
||||||
// only-x86_64
|
// only-x86_64
|
||||||
// only-linux
|
// only-linux
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// run-pass
|
// run-pass
|
||||||
// ^-- The above is needed as this issue is related to LLVM/codegen.
|
// ^-- The above is needed as this issue is related to LLVM/codegen.
|
||||||
// min-llvm-version:15.0.0
|
|
||||||
// ^-- The above is needed as this issue is fixed by the opaque pointers.
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
type_error(|x| &x);
|
type_error(|x| &x);
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// run-pass
|
// run-pass
|
||||||
// compile-flags: -Copt-level=0 -Cllvm-args=-opaque-pointers=0
|
// compile-flags: -Copt-level=0 -Cllvm-args=-opaque-pointers=0
|
||||||
|
|
||||||
// (opaque-pointers flag is called force-opaque-pointers in LLVM 13...)
|
|
||||||
// min-llvm-version: 14.0
|
|
||||||
// (the ability to disable opaque pointers has been removed in LLVM 17)
|
// (the ability to disable opaque pointers has been removed in LLVM 17)
|
||||||
// ignore-llvm-version: 17 - 99
|
// ignore-llvm-version: 17 - 99
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// run-pass
|
// run-pass
|
||||||
// regression test for issue #94923
|
// regression test for issue #94923
|
||||||
// min-llvm-version: 15.0.0
|
|
||||||
// compile-flags: -C opt-level=3
|
// compile-flags: -C opt-level=3
|
||||||
|
|
||||||
fn f0<T>(mut x: usize) -> usize {
|
fn f0<T>(mut x: usize) -> usize {
|
||||||
|
Loading…
Reference in New Issue
Block a user