mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +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
|
||||
os: ubuntu-20.04-16core-64gb
|
||||
env: {}
|
||||
- name: x86_64-gnu-llvm-14
|
||||
- name: x86_64-gnu-llvm-15
|
||||
os: ubuntu-20.04-16core-64gb
|
||||
env: {}
|
||||
- name: x86_64-gnu-tools
|
||||
@ -293,10 +293,6 @@ jobs:
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
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
|
||||
os: ubuntu-20.04-4core-16gb
|
||||
env: {}
|
||||
|
@ -363,50 +363,44 @@ pub fn from_fn_attrs<'ll, 'tcx>(
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR)
|
||||
|| 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));
|
||||
// apply to argument place instead of function
|
||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
|
||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
|
||||
let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
|
||||
flags |= AllocKindFlags::Uninitialized;
|
||||
} else {
|
||||
flags |= AllocKindFlags::Zeroed;
|
||||
}
|
||||
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
|
||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||
// apply to argument place instead of function
|
||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
|
||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
|
||||
let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
|
||||
flags |= AllocKindFlags::Uninitialized;
|
||||
} else {
|
||||
flags |= AllocKindFlags::Zeroed;
|
||||
}
|
||||
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
|
||||
// apply to return place instead of function (unlike all other attributes applied in this function)
|
||||
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
||||
}
|
||||
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(llvm::CreateAllocKindAttr(
|
||||
cx.llcx,
|
||||
AllocKindFlags::Realloc | AllocKindFlags::Aligned,
|
||||
));
|
||||
// applies to argument place instead of function place
|
||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||
// apply to argument place instead of function
|
||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
|
||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
|
||||
}
|
||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||
to_add.push(llvm::CreateAllocKindAttr(
|
||||
cx.llcx,
|
||||
AllocKindFlags::Realloc | AllocKindFlags::Aligned,
|
||||
));
|
||||
// applies to argument place instead of function place
|
||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||
// apply to argument place instead of function
|
||||
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
|
||||
to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
|
||||
let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
|
||||
}
|
||||
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(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
|
||||
// applies to argument place instead of function place
|
||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||
}
|
||||
to_add.push(create_alloc_family_attr(cx.llcx));
|
||||
to_add.push(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
|
||||
// applies to argument place instead of function place
|
||||
let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
|
||||
attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
|
||||
}
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::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
|
||||
.split(',')
|
||||
.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),
|
||||
);
|
||||
|
||||
|
@ -92,10 +92,8 @@ enum LLVMRustAttribute {
|
||||
NoCfCheck = 35,
|
||||
ShadowCallStack = 36,
|
||||
AllocSize = 37,
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
AllocatedPointer = 38,
|
||||
AllocAlign = 39,
|
||||
#endif
|
||||
SanitizeSafeStack = 40,
|
||||
};
|
||||
|
||||
|
@ -801,9 +801,6 @@ LLVMRustOptimize(
|
||||
OptimizerLastEPCallbacks.push_back(
|
||||
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
|
||||
auto CompileKernel = SanitizerOptions->SanitizeKernelAddress;
|
||||
#if LLVM_VERSION_LT(15, 0)
|
||||
MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
|
||||
#endif
|
||||
AddressSanitizerOptions opts = AddressSanitizerOptions{
|
||||
CompileKernel,
|
||||
SanitizerOptions->SanitizeAddressRecover
|
||||
|
@ -277,12 +277,10 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
||||
return Attribute::ShadowCallStack;
|
||||
case AllocSize:
|
||||
return Attribute::AllocSize;
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
case AllocatedPointer:
|
||||
return Attribute::AllocatedPointer;
|
||||
case AllocAlign:
|
||||
return Attribute::AllocAlign;
|
||||
#endif
|
||||
case SanitizeSafeStack:
|
||||
return Attribute::SafeStack;
|
||||
}
|
||||
@ -340,20 +338,12 @@ extern "C" LLVMAttributeRef LLVMRustCreateStructRetAttr(LLVMContextRef C, LLVMTy
|
||||
}
|
||||
|
||||
extern "C" LLVMAttributeRef LLVMRustCreateElementTypeAttr(LLVMContextRef C, LLVMTypeRef Ty) {
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
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) {
|
||||
#if LLVM_VERSION_LT(15, 0)
|
||||
return wrap(Attribute::get(*unwrap(C), Attribute::UWTable));
|
||||
#else
|
||||
return wrap(Attribute::getWithUWTableKind(
|
||||
*unwrap(C), Async ? UWTableKind::Async : UWTableKind::Sync));
|
||||
#endif
|
||||
}
|
||||
|
||||
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.
|
||||
// It _happens_ to match the LLVM values of llvm::AllocFnKind,
|
||||
// but that's happenstance and we do explicit conversions before
|
||||
@ -411,16 +399,10 @@ static llvm::AllocFnKind allocKindFromRust(LLVMRustAllocKindFlags F) {
|
||||
}
|
||||
return AFK;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" LLVMAttributeRef LLVMRustCreateAllocKindAttr(LLVMContextRef C, uint64_t AllocKindArg) {
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
return wrap(Attribute::get(*unwrap(C), Attribute::AllocKind,
|
||||
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.
|
||||
@ -517,14 +499,9 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
|
||||
|
||||
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
|
||||
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.
|
||||
return !llvm::errorToBool(InlineAsm::verify(
|
||||
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef DIBuilder *LLVMRustDIBuilderRef;
|
||||
@ -1649,19 +1626,11 @@ extern "C" bool LLVMRustConstInt128Get(LLVMValueRef CV, bool sext, uint64_t *hig
|
||||
auto C = unwrap<llvm::ConstantInt>(CV);
|
||||
if (C->getBitWidth() > 128) { return false; }
|
||||
APInt AP;
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
if (sext) {
|
||||
AP = C->getValue().sext(128);
|
||||
} else {
|
||||
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();
|
||||
*high = AP.getHiBits(64).getZExtValue();
|
||||
return true;
|
||||
@ -2037,16 +2006,7 @@ extern "C" void LLVMRustGetMangledName(LLVMValueRef V, RustStringRef Str) {
|
||||
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) {
|
||||
#if LLVM_VERSION_GE(15, 0)
|
||||
auto *CB = unwrap<CallBase>(CallSite);
|
||||
switch (CB->getIntrinsicID()) {
|
||||
case Intrinsic::arm_ldrex:
|
||||
@ -2054,7 +2014,6 @@ extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
|
||||
case Intrinsic::arm_strex:
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -525,11 +525,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
|
||||
let version = output(cmd.arg("--version"));
|
||||
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 major >= 14 {
|
||||
if major >= 15 {
|
||||
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(
|
||||
|
@ -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
|
||||
|
||||
@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
file \
|
||||
curl \
|
||||
ca-certificates \
|
||||
python3 \
|
||||
python3.11 \
|
||||
git \
|
||||
cmake \
|
||||
sudo \
|
||||
@ -49,20 +49,6 @@ ENV RUST_CONFIGURE_ARGS \
|
||||
--enable-llvm-link-shared \
|
||||
--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.
|
||||
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.
|
||||
# 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
|
||||
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
||||
|
||||
ENV SCRIPT /tmp/script.sh
|
||||
|
@ -45,20 +45,6 @@ ENV RUST_CONFIGURE_ARGS \
|
||||
--enable-llvm-link-shared \
|
||||
--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.
|
||||
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.
|
||||
# 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
|
||||
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
||||
|
||||
ENV SCRIPT /tmp/script.sh
|
||||
|
@ -323,7 +323,7 @@ jobs:
|
||||
- name: mingw-check-tidy
|
||||
<<: *job-linux-16c
|
||||
|
||||
- name: x86_64-gnu-llvm-14
|
||||
- name: x86_64-gnu-llvm-15
|
||||
<<: *job-linux-16c
|
||||
|
||||
- name: x86_64-gnu-tools
|
||||
@ -469,11 +469,6 @@ jobs:
|
||||
RUST_BACKTRACE: 1
|
||||
<<: *job-linux-8c
|
||||
|
||||
- name: x86_64-gnu-llvm-14
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
<<: *job-linux-8c
|
||||
|
||||
- name: x86_64-gnu-nopt
|
||||
<<: *job-linux-4c
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// assembly-output: emit-asm
|
||||
// min-llvm-version: 15.0
|
||||
// only-x86_64
|
||||
// ignore-sgx
|
||||
// revisions: opt-speed opt-size
|
||||
|
@ -3,7 +3,6 @@
|
||||
// [LIN] only-linux
|
||||
// assembly-output: emit-asm
|
||||
// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
|
||||
// min-llvm-version: 14
|
||||
// only-x86_64
|
||||
// ignore-sgx
|
||||
// ignore-debug
|
||||
|
@ -2,7 +2,6 @@
|
||||
// compile-flags: -Copt-level=1
|
||||
// only-x86_64
|
||||
// ignore-sgx
|
||||
// min-llvm-version: 15.0
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
// CHECK-LABEL: old_style
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -C opt-level=3 -C no-prepopulate-passes
|
||||
// min-llvm-version: 15.0 (for opaque pointers)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// 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)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -O -C no-prepopulate-passes
|
||||
// min-llvm-version: 15.0 (for opaque pointers)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 15.0
|
||||
#![crate_type = "lib"]
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -C opt-level=1 -Z merge-functions=disabled
|
||||
// min-llvm-version: 15.0
|
||||
// only-x86_64
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -3,7 +3,6 @@
|
||||
// in the operators for such a type all optimize away.
|
||||
|
||||
// compile-flags: -C opt-level=1
|
||||
// min-llvm-version: 15.0
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -C no-prepopulate-passes
|
||||
// min-llvm-version: 15.0 (for opaque pointers)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -O -C no-prepopulate-passes
|
||||
// min-llvm-version: 15.0 (because we're using opaque pointers)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -2,7 +2,6 @@
|
||||
// [OPT] compile-flags: -C opt-level=3 -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)
|
||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// compile-flags: -O -C no-prepopulate-passes
|
||||
// only-x86_64 (it's using arch-specific types)
|
||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// compile-flags: -O -C no-prepopulate-passes
|
||||
// only-64bit (so I don't need to worry about usize)
|
||||
// min-llvm-version: 15.0 # this test assumes `ptr`s
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -1,6 +1,5 @@
|
||||
// compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes -Zmir-enable-passes=-ScalarReplacementOfAggregates
|
||||
// MIR SROA will decompose the closure
|
||||
// min-llvm-version: 15.0 # this test uses opaque pointer notation
|
||||
#![feature(stmt_expr_attributes)]
|
||||
|
||||
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
|
||||
// when generating debuginfo.
|
||||
// CHECK-LABEL: @outer_function
|
||||
// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:10:23: 10:25]"
|
||||
// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:10:23: 10:25]", ptr [[spill]]
|
||||
// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
|
||||
// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
|
||||
// CHECK-NOT: [[load:%.*]] = load ptr, ptr
|
||||
// CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
|
||||
// CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
|
||||
|
@ -1,4 +1,3 @@
|
||||
// min-llvm-version: 15.0.0
|
||||
// compile-flags: -O
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -1,4 +1,3 @@
|
||||
// min-llvm-version: 15.0
|
||||
// only-64bit llvm appears to use stores instead of memset on 32bit
|
||||
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// min-llvm-version: 15.0
|
||||
// compile-flags: -O
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -3,7 +3,6 @@
|
||||
// in some situations, see https://github.com/rust-lang/rust/issues/96497#issuecomment-1112865218
|
||||
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 15.0
|
||||
|
||||
#![crate_type="lib"]
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// min-llvm-version: 15.0.0
|
||||
// ignore-debug: The debug assertions get in the way
|
||||
// compile-flags: -O
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -O -C no-prepopulate-passes
|
||||
// min-llvm-version: 15.0 (for opaque pointers)
|
||||
// only-x86_64 (to not worry about usize differing)
|
||||
// ignore-debug (the debug assertions get in the way)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// compile-flags: -O
|
||||
// only-64bit (because we're using [ui]size)
|
||||
// ignore-debug (because the assertions get in the way)
|
||||
// min-llvm-version: 15.0 (because this is a relatively new instcombine)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(slice_from_ptr_range)]
|
||||
|
@ -1,5 +1,4 @@
|
||||
// compile-flags: -O -Z merge-functions=disabled
|
||||
// min-llvm-version: 15.0 # this test uses `ptr`s
|
||||
// ignore-debug
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -1,5 +1,4 @@
|
||||
// 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"]
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
// min-llvm-version: 15.0
|
||||
// compile-flags: -O -Z merge-functions=disabled --edition=2021
|
||||
// only-x86_64
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
// 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)
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -1,5 +1,4 @@
|
||||
// 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.
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// compile-flags: -O -Z merge-functions=disabled
|
||||
// only-x86_64
|
||||
// ignore-debug
|
||||
// min-llvm-version: 15.0
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// build-pass
|
||||
// compile-flags: -O
|
||||
// min-llvm-version: 14.0.5
|
||||
// needs-asm-support
|
||||
// only-x86_64
|
||||
// only-linux
|
||||
|
@ -1,7 +1,5 @@
|
||||
// run-pass
|
||||
// ^-- 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() {
|
||||
type_error(|x| &x);
|
||||
|
@ -1,8 +1,6 @@
|
||||
// run-pass
|
||||
// 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)
|
||||
// ignore-llvm-version: 17 - 99
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
// run-pass
|
||||
// regression test for issue #94923
|
||||
// min-llvm-version: 15.0.0
|
||||
// compile-flags: -C opt-level=3
|
||||
|
||||
fn f0<T>(mut x: usize) -> usize {
|
||||
|
Loading…
Reference in New Issue
Block a user