]> git.lizzy.rs Git - rust.git/commitdiff
Update the minimum external LLVM to 13
authorJosh Stone <jistone@redhat.com>
Fri, 12 Aug 2022 17:22:38 +0000 (10:22 -0700)
committerJosh Stone <jistone@redhat.com>
Sun, 14 Aug 2022 20:46:51 +0000 (13:46 -0700)
36 files changed:
.github/workflows/ci.yml
compiler/rustc_codegen_llvm/src/asm.rs
compiler/rustc_codegen_llvm/src/back/write.rs
compiler/rustc_codegen_llvm/src/builder.rs
compiler/rustc_codegen_llvm/src/context.rs
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
compiler/rustc_codegen_llvm/src/llvm_util.rs
compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
library/core/src/cmp.rs
src/bootstrap/native.rs
src/ci/docker/host-x86_64/x86_64-gnu-llvm-12-stage1/Dockerfile [deleted file]
src/ci/docker/host-x86_64/x86_64-gnu-llvm-12/Dockerfile [deleted file]
src/ci/docker/host-x86_64/x86_64-gnu-llvm-13-stage1/Dockerfile [new file with mode: 0644]
src/ci/docker/host-x86_64/x86_64-gnu-llvm-13/Dockerfile [new file with mode: 0644]
src/ci/github-actions/ci.yml
src/test/assembly/aarch64-pointer-auth.rs
src/test/assembly/asm/avr-modifiers.rs
src/test/assembly/asm/avr-types.rs
src/test/assembly/asm/bpf-types.rs
src/test/assembly/asm/msp430-types.rs
src/test/assembly/asm/powerpc-types.rs
src/test/assembly/stack-protector/stack-protector-target-support.rs
src/test/codegen/asm-may_unwind.rs
src/test/codegen/atomic-operations-llvm-12.rs [deleted file]
src/test/codegen/atomic-operations.rs
src/test/codegen/branch-protection.rs
src/test/codegen/merge-functions.rs
src/test/mir-opt/asm_unwind_panic_abort.rs
src/test/ui/asm/aarch64/may_unwind.rs
src/test/ui/asm/may_unwind.rs
src/test/ui/asm/x86_64/may_unwind.rs
src/test/ui/asm/x86_64/sym.rs
src/test/ui/ptr_ops/issue-80309-safe.rs
src/test/ui/ptr_ops/issue-80309.rs

index ceda348025e364bff23cfdb24679939f8f7b8646..7eb41fec36aba9615db2496eb479ad96106abbd0 100644 (file)
@@ -43,7 +43,7 @@ jobs:
           - name: mingw-check
             os: ubuntu-20.04-xl
             env: {}
-          - name: x86_64-gnu-llvm-12
+          - name: x86_64-gnu-llvm-13
             os: ubuntu-20.04-xl
             env: {}
           - name: x86_64-gnu-tools
@@ -274,11 +274,11 @@ jobs:
           - name: x86_64-gnu-distcheck
             os: ubuntu-20.04-xl
             env: {}
-          - name: x86_64-gnu-llvm-12
+          - name: x86_64-gnu-llvm-13
             env:
               RUST_BACKTRACE: 1
             os: ubuntu-20.04-xl
-          - name: x86_64-gnu-llvm-12-stage1
+          - name: x86_64-gnu-llvm-13-stage1
             env:
               RUST_BACKTRACE: 1
             os: ubuntu-20.04-xl
index a53946995ee1c43d484f35369c4e31d72fb9fecf..2a6612eb86f12c62b41f516b41dfe18c5cd40806 100644 (file)
@@ -3,7 +3,6 @@
 use crate::common::Funclet;
 use crate::context::CodegenCx;
 use crate::llvm;
-use crate::llvm_util;
 use crate::type_::Type;
 use crate::type_of::LayoutLlvmExt;
 use crate::value::Value;
@@ -419,13 +418,6 @@ pub(crate) fn inline_asm_call<'ll>(
         let constraints_ok = llvm::LLVMRustInlineAsmVerify(fty, cons.as_ptr().cast(), cons.len());
         debug!("constraint verification result: {:?}", constraints_ok);
         if constraints_ok {
-            if unwind && llvm_util::get_version() < (13, 0, 0) {
-                bx.cx.sess().span_fatal(
-                    line_spans[0],
-                    "unwinding from inline assembly is only supported on llvm >= 13.",
-                );
-            }
-
             let v = llvm::LLVMRustInlineAsm(
                 fty,
                 asm.as_ptr().cast(),
index 534d32e8a90e994d97aeb27a788f6224d742be32..73b089b1617eeef009a657af9b81c4c5b8ec1807 100644 (file)
@@ -5,7 +5,7 @@
 use crate::base;
 use crate::common;
 use crate::consts;
-use crate::llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
+use crate::llvm::{self, DiagnosticInfo, PassManager};
 use crate::llvm_util;
 use crate::type_::Type;
 use crate::LlvmCodegenBackend;
@@ -304,7 +304,6 @@ pub fn new(
                 remark_passes.as_ptr(),
                 remark_passes.len(),
             );
-            llvm::LLVMRustSetInlineAsmDiagnosticHandler(llcx, inline_asm_handler, data.cast());
             DiagnosticHandlers { data, llcx, old_handler }
         }
     }
@@ -312,9 +311,7 @@ pub fn new(
 
 impl<'a> Drop for DiagnosticHandlers<'a> {
     fn drop(&mut self) {
-        use std::ptr::null_mut;
         unsafe {
-            llvm::LLVMRustSetInlineAsmDiagnosticHandler(self.llcx, inline_asm_handler, null_mut());
             llvm::LLVMRustContextSetDiagnosticHandler(self.llcx, self.old_handler);
             drop(Box::from_raw(self.data));
         }
@@ -342,16 +339,6 @@ fn report_inline_asm(
     cgcx.diag_emitter.inline_asm_error(cookie as u32, msg, level, source);
 }
 
-unsafe extern "C" fn inline_asm_handler(diag: &SMDiagnostic, user: *const c_void, cookie: c_uint) {
-    if user.is_null() {
-        return;
-    }
-    let (cgcx, _) = *(user as *const (&CodegenContext<LlvmCodegenBackend>, &Handler));
-
-    let smdiag = llvm::diagnostic::SrcMgrDiagnostic::unpack(diag);
-    report_inline_asm(cgcx, smdiag.message, smdiag.level, cookie, smdiag.source);
-}
-
 unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void) {
     if user.is_null() {
         return;
index d3096c73a8a9ddc603565fb36c8878be8fff0d5e..073feecb1647f1b37236479ff828f9c6ae938f09 100644 (file)
@@ -3,7 +3,6 @@
 use crate::context::CodegenCx;
 use crate::llvm::{self, BasicBlock, False};
 use crate::llvm::{AtomicOrdering, AtomicRmwBinOp, SynchronizationScope};
-use crate::llvm_util;
 use crate::type_::Type;
 use crate::type_of::LayoutLlvmExt;
 use crate::value::Value;
@@ -1038,25 +1037,11 @@ fn atomic_cmpxchg(
         dst: &'ll Value,
         cmp: &'ll Value,
         src: &'ll Value,
-        mut order: rustc_codegen_ssa::common::AtomicOrdering,
+        order: rustc_codegen_ssa::common::AtomicOrdering,
         failure_order: rustc_codegen_ssa::common::AtomicOrdering,
         weak: bool,
     ) -> &'ll Value {
         let weak = if weak { llvm::True } else { llvm::False };
-        if llvm_util::get_version() < (13, 0, 0) {
-            use rustc_codegen_ssa::common::AtomicOrdering::*;
-            // Older llvm has the pre-C++17 restriction on
-            // success and failure memory ordering,
-            // requiring the former to be at least as strong as the latter.
-            // So, for llvm 12, we upgrade the success ordering to a stronger
-            // one if necessary.
-            match (order, failure_order) {
-                (Relaxed, Acquire) => order = Acquire,
-                (Release, Acquire) => order = AcquireRelease,
-                (_, SequentiallyConsistent) => order = SequentiallyConsistent,
-                _ => {}
-            }
-        }
         unsafe {
             llvm::LLVMRustBuildAtomicCmpXchg(
                 self.llbuilder,
@@ -1444,51 +1429,37 @@ fn add_incoming_to_phi(&mut self, phi: &'ll Value, val: &'ll Value, bb: &'ll Bas
         }
     }
 
-    fn fptoint_sat_broken_in_llvm(&self) -> bool {
-        match self.tcx.sess.target.arch.as_ref() {
-            // FIXME - https://bugs.llvm.org/show_bug.cgi?id=50083
-            "riscv64" => llvm_util::get_version() < (13, 0, 0),
-            _ => false,
-        }
-    }
-
     fn fptoint_sat(
         &mut self,
         signed: bool,
         val: &'ll Value,
         dest_ty: &'ll Type,
     ) -> Option<&'ll Value> {
-        if !self.fptoint_sat_broken_in_llvm() {
-            let src_ty = self.cx.val_ty(val);
-            let (float_ty, int_ty, vector_length) = if self.cx.type_kind(src_ty) == TypeKind::Vector
-            {
-                assert_eq!(self.cx.vector_length(src_ty), self.cx.vector_length(dest_ty));
-                (
-                    self.cx.element_type(src_ty),
-                    self.cx.element_type(dest_ty),
-                    Some(self.cx.vector_length(src_ty)),
-                )
-            } else {
-                (src_ty, dest_ty, None)
-            };
-            let float_width = self.cx.float_width(float_ty);
-            let int_width = self.cx.int_width(int_ty);
-
-            let instr = if signed { "fptosi" } else { "fptoui" };
-            let name = if let Some(vector_length) = vector_length {
-                format!(
-                    "llvm.{}.sat.v{}i{}.v{}f{}",
-                    instr, vector_length, int_width, vector_length, float_width
-                )
-            } else {
-                format!("llvm.{}.sat.i{}.f{}", instr, int_width, float_width)
-            };
-            let f =
-                self.declare_cfn(&name, llvm::UnnamedAddr::No, self.type_func(&[src_ty], dest_ty));
-            Some(self.call(self.type_func(&[src_ty], dest_ty), f, &[val], None))
+        let src_ty = self.cx.val_ty(val);
+        let (float_ty, int_ty, vector_length) = if self.cx.type_kind(src_ty) == TypeKind::Vector {
+            assert_eq!(self.cx.vector_length(src_ty), self.cx.vector_length(dest_ty));
+            (
+                self.cx.element_type(src_ty),
+                self.cx.element_type(dest_ty),
+                Some(self.cx.vector_length(src_ty)),
+            )
         } else {
-            None
-        }
+            (src_ty, dest_ty, None)
+        };
+        let float_width = self.cx.float_width(float_ty);
+        let int_width = self.cx.int_width(int_ty);
+
+        let instr = if signed { "fptosi" } else { "fptoui" };
+        let name = if let Some(vector_length) = vector_length {
+            format!(
+                "llvm.{}.sat.v{}i{}.v{}f{}",
+                instr, vector_length, int_width, vector_length, float_width
+            )
+        } else {
+            format!("llvm.{}.sat.i{}.f{}", instr, int_width, float_width)
+        };
+        let f = self.declare_cfn(&name, llvm::UnnamedAddr::No, self.type_func(&[src_ty], dest_ty));
+        Some(self.call(self.type_func(&[src_ty], dest_ty), f, &[val], None))
     }
 
     pub(crate) fn landing_pad(
index 5857b83f6c971176a91baf4c3e9f3bb5e67547dc..d4d84147239068184b0f54bb68c34bfa6df4c3ac 100644 (file)
@@ -142,17 +142,6 @@ pub unsafe fn create_module<'ll>(
 
     let mut target_data_layout = sess.target.data_layout.to_string();
     let llvm_version = llvm_util::get_version();
-    if llvm_version < (13, 0, 0) {
-        if sess.target.arch == "powerpc64" {
-            target_data_layout = target_data_layout.replace("-S128", "");
-        }
-        if sess.target.arch == "wasm32" {
-            target_data_layout = "e-m:e-p:32:32-i64:64-n32:64-S128".to_string();
-        }
-        if sess.target.arch == "wasm64" {
-            target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128".to_string();
-        }
-    }
     if llvm_version < (14, 0, 0) {
         if sess.target.llvm_target == "i686-pc-windows-msvc"
             || sess.target.llvm_target == "i586-pc-windows-msvc"
index 3139f93bfefaee9c0daf0c01734d5442983f8b9d..9d5b8383caf7cc7db52abafc7136f37a3a4f5939 100644 (file)
@@ -2410,12 +2410,6 @@ pub fn LLVMRustGetSMDiagnostic<'a>(
         cookie_out: &mut c_uint,
     ) -> &'a SMDiagnostic;
 
-    pub fn LLVMRustSetInlineAsmDiagnosticHandler(
-        C: &Context,
-        H: InlineAsmDiagHandlerTy,
-        CX: *mut c_void,
-    );
-
     #[allow(improper_ctypes)]
     pub fn LLVMRustUnpackSMDiagnostic(
         d: &SMDiagnostic,
index 96d238eda59d08d417a5910a505d8c5ea0f5bcde..f5d676c44e3428b83677bd237daf7e5ad9ca2782 100644 (file)
@@ -92,16 +92,6 @@ fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
             add("-generate-arange-section", false);
         }
 
-        // Disable the machine outliner by default in LLVM versions 11 and LLVM
-        // version 12, where it leads to miscompilation.
-        //
-        // Ref:
-        // - https://github.com/rust-lang/rust/issues/85351
-        // - https://reviews.llvm.org/D103167
-        if llvm_util::get_version() < (13, 0, 0) {
-            add("-enable-machine-outliner=never", false);
-        }
-
         match sess.opts.unstable_opts.merge_functions.unwrap_or(sess.target.merge_functions) {
             MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
             MergeFunctions::Aliases => {
index 154f554d607dfb60af9afaa03d54952f96d4a178..7da6ab71309ddff57b11120ed1f0450616c97b5f 100644 (file)
@@ -24,17 +24,10 @@ extern "C" void LLVMRustCoverageWriteFilenamesSectionToBuffer(
     const char* const Filenames[],
     size_t FilenamesLen,
     RustStringRef BufferOut) {
-#if LLVM_VERSION_GE(13,0)
   SmallVector<std::string,32> FilenameRefs;
   for (size_t i = 0; i < FilenamesLen; i++) {
     FilenameRefs.push_back(std::string(Filenames[i]));
   }
-#else
-  SmallVector<StringRef,32> FilenameRefs;
-  for (size_t i = 0; i < FilenamesLen; i++) {
-    FilenameRefs.push_back(StringRef(Filenames[i]));
-  }
-#endif
   auto FilenamesWriter = coverage::CoverageFilenamesSectionWriter(
     makeArrayRef(FilenameRefs));
   RawRustStringOstream OS(BufferOut);
@@ -109,9 +102,5 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
 }
 
 extern "C" uint32_t LLVMRustCoverageMappingVersion() {
-#if LLVM_VERSION_GE(13, 0)
   return coverage::CovMapVersion::Version6;
-#else
-  return coverage::CovMapVersion::Version5;
-#endif
 }
index 0a6bd49992d9932f37326f75cfba45d046ed6e1e..844bc8aba0631477e2a1050e109106082f80a6a6 100644 (file)
@@ -869,19 +869,11 @@ LLVMRustOptimizeWithNewPassManager(
                         PGOOptions::NoCSAction, DebugInfoForProfiling);
   }
 
-#if LLVM_VERSION_GE(13, 0)
   PassBuilder PB(TM, PTO, PGOOpt, &PIC);
   LoopAnalysisManager LAM;
   FunctionAnalysisManager FAM;
   CGSCCAnalysisManager CGAM;
   ModuleAnalysisManager MAM;
-#else
-  PassBuilder PB(DebugPassManager, TM, PTO, PGOOpt, &PIC);
-  LoopAnalysisManager LAM(DebugPassManager);
-  FunctionAnalysisManager FAM(DebugPassManager);
-  CGSCCAnalysisManager CGAM(DebugPassManager);
-  ModuleAnalysisManager MAM(DebugPassManager);
-#endif
 
   FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });
 
@@ -1015,11 +1007,7 @@ LLVMRustOptimizeWithNewPassManager(
     }
   }
 
-#if LLVM_VERSION_GE(13, 0)
   ModulePassManager MPM;
-#else
-  ModulePassManager MPM(DebugPassManager);
-#endif
   bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
   if (!NoPrepopulatePasses) {
     // The pre-link pipelines don't support O0 and require using budilO0DefaultPipeline() instead.
@@ -1434,17 +1422,13 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
     Ret->ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
   };
 
-#if LLVM_VERSION_GE(13,0)
   // Uses FromPrevailing visibility scheme which works for many binary
   // formats. We probably could and should use ELF visibility scheme for many of
   // our targets, however.
   lto::Config conf;
   thinLTOResolvePrevailingInIndex(conf, Ret->Index, isPrevailing, recordNewLinkage,
                                   Ret->GUIDPreservedSymbols);
-#else
-  thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage,
-                                  Ret->GUIDPreservedSymbols);
-#endif
+
   // Here we calculate an `ExportedGUIDs` set for use in the `isExported`
   // callback below. This callback below will dictate the linkage for all
   // summaries in the index, and we basically just only want to ensure that dead
index 5f5b5de790e430e4e2823c491c0536325638c793..14d3f61b9d003e6184719dc05fa2d3cd008014ee 100644 (file)
@@ -413,18 +413,12 @@ LLVMRustBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Target,
                            LLVMValueRef Old, LLVMValueRef Source,
                            LLVMAtomicOrdering Order,
                            LLVMAtomicOrdering FailureOrder, LLVMBool Weak) {
-#if LLVM_VERSION_GE(13,0)
   // Rust probably knows the alignment of the target value and should be able to
   // specify something more precise than MaybeAlign here. See also
   // https://reviews.llvm.org/D97224 which may be a useful reference.
   AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
       unwrap(Target), unwrap(Old), unwrap(Source), llvm::MaybeAlign(), fromRust(Order),
       fromRust(FailureOrder));
-#else
-  AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
-      unwrap(Target), unwrap(Old), unwrap(Source), fromRust(Order),
-      fromRust(FailureOrder));
-#endif
   ACXI->setWeak(Weak);
   return wrap(ACXI);
 }
@@ -472,19 +466,11 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
                   char *Constraints, size_t ConstraintsLen,
                   LLVMBool HasSideEffects, LLVMBool IsAlignStack,
                   LLVMRustAsmDialect Dialect, LLVMBool CanThrow) {
-#if LLVM_VERSION_GE(13, 0)
   return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
                              StringRef(AsmString, AsmStringLen),
                              StringRef(Constraints, ConstraintsLen),
                              HasSideEffects, IsAlignStack,
                              fromRust(Dialect), CanThrow));
-#else
-  return wrap(InlineAsm::get(unwrap<FunctionType>(Ty),
-                             StringRef(AsmString, AsmStringLen),
-                             StringRef(Constraints, ConstraintsLen),
-                             HasSideEffects, IsAlignStack,
-                             fromRust(Dialect)));
-#endif
 }
 
 extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
@@ -1250,10 +1236,8 @@ static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
     return LLVMRustDiagnosticKind::Linker;
   case DK_Unsupported:
     return LLVMRustDiagnosticKind::Unsupported;
-#if LLVM_VERSION_GE(13, 0)
   case DK_SrcMgr:
     return LLVMRustDiagnosticKind::SrcMgr;
-#endif
   default:
     return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
                ? LLVMRustDiagnosticKind::OptimizationRemarkOther
@@ -1327,30 +1311,11 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
 
 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)
 
-#if LLVM_VERSION_LT(13, 0)
-using LLVMInlineAsmDiagHandlerTy = LLVMContext::InlineAsmDiagHandlerTy;
-#else
-using LLVMInlineAsmDiagHandlerTy = void*;
-#endif
-
-extern "C" void LLVMRustSetInlineAsmDiagnosticHandler(
-    LLVMContextRef C, LLVMInlineAsmDiagHandlerTy H, void *CX) {
-  // Diagnostic handlers were unified in LLVM change 5de2d189e6ad, so starting
-  // with LLVM 13 this function is gone.
-#if LLVM_VERSION_LT(13, 0)
-  unwrap(C)->setInlineAsmDiagnosticHandler(H, CX);
-#endif
-}
-
 extern "C" LLVMSMDiagnosticRef LLVMRustGetSMDiagnostic(
     LLVMDiagnosticInfoRef DI, unsigned *Cookie) {
-#if LLVM_VERSION_GE(13, 0)
   llvm::DiagnosticInfoSrcMgr *SM = static_cast<llvm::DiagnosticInfoSrcMgr *>(unwrap(DI));
   *Cookie = SM->getLocCookie();
   return wrap(&SM->getSMDiag());
-#else
-  report_fatal_error("Shouldn't get called on older versions");
-#endif
 }
 
 extern "C" bool LLVMRustUnpackSMDiagnostic(LLVMSMDiagnosticRef DRef,
index 20bb67687848fc1cb9c68dcdab594b2553743b39..171f49022369a8544a15a70e5bbf61b2611ca426 100644 (file)
@@ -1139,11 +1139,7 @@ fn lt(&self, other: &Rhs) -> bool {
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn le(&self, other: &Rhs) -> bool {
-        // Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
-        // FIXME: The root cause was fixed upstream in LLVM with:
-        // https://github.com/llvm/llvm-project/commit/9bad7de9a3fb844f1ca2965f35d0c2a3d1e11775
-        // Revert this workaround once support for LLVM 12 gets dropped.
-        !matches!(self.partial_cmp(other), None | Some(Greater))
+        matches!(self.partial_cmp(other), Some(Less | Equal))
     }
 
     /// This method tests greater than (for `self` and `other`) and is used by the `>` operator.
index 8b50d5dc52bc179ee08c33ef91dd76e37f556c0e..1bba5e68be446be6cd88c931dfa0a13d84f1dd86 100644 (file)
@@ -515,11 +515,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 >= 12 {
+        if major >= 13 {
             return;
         }
     }
-    panic!("\n\nbad LLVM version: {}, need >=12.0\n\n", version)
+    panic!("\n\nbad LLVM version: {}, need >=13.0\n\n", version)
 }
 
 fn configure_cmake(
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-12-stage1/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-12-stage1/Dockerfile
deleted file mode 100644 (file)
index c2f3a16..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-FROM ubuntu:20.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 \
-    python2.7 \
-    git \
-    cmake \
-    sudo \
-    gdb \
-    llvm-12-tools \
-    llvm-12-dev \
-    libedit-dev \
-    libssl-dev \
-    pkg-config \
-    zlib1g-dev \
-    xz-utils \
-    nodejs
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# 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-12 \
-    --enable-llvm-link-shared \
-    --set rust.thin-lto-import-instr-limit=10
-
-ENV SCRIPT python2.7 ../x.py --stage 1 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.
-    python2.7 ../x.py --stage 1 test src/test/mir-opt \
-    --host='' --target=i686-unknown-linux-gnu
\ No newline at end of file
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-12/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-12/Dockerfile
deleted file mode 100644 (file)
index 14d0ffd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-FROM ubuntu:20.04
-
-ARG DEBIAN_FRONTEND=noninteractive
-
-# NOTE: intentionally installs both python2 and python3 so we can test support for both.
-RUN apt-get update && apt-get install -y --no-install-recommends \
-  g++ \
-  gcc-multilib \
-  make \
-  ninja-build \
-  file \
-  curl \
-  ca-certificates \
-  python2.7 \
-  python3.9 \
-  git \
-  cmake \
-  sudo \
-  gdb \
-  llvm-12-tools \
-  llvm-12-dev \
-  libedit-dev \
-  libssl-dev \
-  pkg-config \
-  zlib1g-dev \
-  xz-utils \
-  nodejs
-
-# Install powershell so we can test x.ps1 on Linux
-RUN apt-get update && \
-    apt-get install -y apt-transport-https software-properties-common && \
-    curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb && \
-    dpkg -i packages-microsoft-prod.deb && \
-    apt-get update && \
-    apt-get install -y powershell
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# 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-12 \
-      --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 src/test/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 src/test/ui --pass=check \
-                             --host='' --target=i686-unknown-linux-gnu && \
-           # Run tidy at the very end, after all the other tests.
-           python2.7 ../x.py --stage 2 test src/tools/tidy
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-13-stage1/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-13-stage1/Dockerfile
new file mode 100644 (file)
index 0000000..21891c1
--- /dev/null
@@ -0,0 +1,44 @@
+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 \
+    python2.7 \
+    git \
+    cmake \
+    sudo \
+    gdb \
+    llvm-13-tools \
+    llvm-13-dev \
+    libedit-dev \
+    libssl-dev \
+    pkg-config \
+    zlib1g-dev \
+    xz-utils \
+    nodejs
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+# 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-13 \
+    --enable-llvm-link-shared \
+    --set rust.thin-lto-import-instr-limit=10
+
+ENV SCRIPT python2.7 ../x.py --stage 1 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.
+    python2.7 ../x.py --stage 1 test src/test/mir-opt \
+    --host='' --target=i686-unknown-linux-gnu
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-13/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-13/Dockerfile
new file mode 100644 (file)
index 0000000..5f3af2f
--- /dev/null
@@ -0,0 +1,65 @@
+FROM ubuntu:22.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+# NOTE: intentionally installs both python2 and python3 so we can test support for both.
+RUN apt-get update && apt-get install -y --no-install-recommends \
+  g++ \
+  gcc-multilib \
+  make \
+  ninja-build \
+  file \
+  curl \
+  ca-certificates \
+  python2.7 \
+  python3.9 \
+  git \
+  cmake \
+  sudo \
+  gdb \
+  llvm-13-tools \
+  llvm-13-dev \
+  libedit-dev \
+  libssl-dev \
+  pkg-config \
+  zlib1g-dev \
+  xz-utils \
+  nodejs
+
+# Install powershell so we can test x.ps1 on Linux
+RUN apt-get update && \
+    apt-get install -y apt-transport-https software-properties-common && \
+    curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb && \
+    dpkg -i packages-microsoft-prod.deb && \
+    apt-get update && \
+    apt-get install -y powershell
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+# 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-13 \
+      --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 src/test/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 src/test/ui --pass=check \
+                             --host='' --target=i686-unknown-linux-gnu && \
+           # Run tidy at the very end, after all the other tests.
+           python2.7 ../x.py --stage 2 test src/tools/tidy
index a21400cc4726d04e5161bb76a4bea7e6bb288843..91204eb0b05725e7d89f8a74f220dd086c8f98b3 100644 (file)
@@ -284,7 +284,7 @@ jobs:
           - name: mingw-check
             <<: *job-linux-xl
 
-          - name: x86_64-gnu-llvm-12
+          - name: x86_64-gnu-llvm-13
             <<: *job-linux-xl
             
           - name: x86_64-gnu-tools
@@ -431,12 +431,12 @@ jobs:
           - name: x86_64-gnu-distcheck
             <<: *job-linux-xl
 
-          - name: x86_64-gnu-llvm-12
+          - name: x86_64-gnu-llvm-13
             env:
               RUST_BACKTRACE: 1
             <<: *job-linux-xl
 
-          - name: x86_64-gnu-llvm-12-stage1
+          - name: x86_64-gnu-llvm-13-stage1
             env:
               RUST_BACKTRACE: 1
             <<: *job-linux-xl
index 27e289086b9dd00c9c14256a1975243a2bd57b85..da14cd026780a0dba968ddb1205e52140d4c130a 100644 (file)
@@ -1,6 +1,5 @@
 // Test that PAC instructions are emitted when branch-protection is specified.
 
-// min-llvm-version: 10.0.1
 // assembly-output: emit-asm
 // compile-flags: --target aarch64-unknown-linux-gnu
 // compile-flags: -Z branch-protection=pac-ret,leaf
index aba4c982c7305ac9e311ec1b3f0819bb9171c1aa..ffdc8f2e351dd0b1ab5256080e7dea03f3b83bcd 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0
 // assembly-output: emit-asm
 // compile-flags: --target avr-unknown-gnu-atmega328
 // needs-llvm-components: avr
index 53a601e51c8bf75be9cf71a80abbd98740879e47..58bf1ad9e35eb1429e43c0f2308e91689610e269 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0
 // assembly-output: emit-asm
 // compile-flags: --target avr-unknown-gnu-atmega328
 // needs-llvm-components: avr
index 3428d93fb1205d60b3e3040a76996cbbc4552c08..f894644cc20ee50cab09aff52b2770c9541124ae 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0
 // assembly-output: emit-asm
 // compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
 // needs-llvm-components: bpf
index 6cfb86e276e2306bd93fd8a344b19edc9c25f544..4fa2e8081f816bbf32fb28a964ee2cb84c0c9219 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0
 // assembly-output: emit-asm
 // compile-flags: --target msp430-none-elf
 // needs-llvm-components: msp430
index b8859c07e164fe03a38ba7654802920bf488f6bc..0ca8908497ad7b74f2ae23dab7420aedcbb35c29 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 12.0.1
 // revisions: powerpc powerpc64
 // assembly-output: emit-asm
 //[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
index 5ba46d082e157975ea6ab810b18359742b5055f2..2fb62e93ea36c0909f699aa2be526809afabc334 100644 (file)
 // [r74] needs-llvm-components: x86
 // [r75] compile-flags:--target x86_64-fortanix-unknown-sgx
 // [r75] needs-llvm-components: x86
-// [r75] min-llvm-version: 11.0.0
 // [r76] compile-flags:--target x86_64-fuchsia
 // [r76] needs-llvm-components: x86
 // [r77] compile-flags:--target x86_64-linux-android
index bf4202764a7ec665ebdaa4ac97debda0a95b4b03..c97933035d101898a690d27ab9c62388d2649422 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
 // compile-flags: -O
 // only-x86_64
 
diff --git a/src/test/codegen/atomic-operations-llvm-12.rs b/src/test/codegen/atomic-operations-llvm-12.rs
deleted file mode 100644 (file)
index bd4c63d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-// Code generation of atomic operations for LLVM 12
-// ignore-llvm-version: 13 - 99
-// compile-flags: -O
-#![crate_type = "lib"]
-
-use std::sync::atomic::{AtomicI32, Ordering::*};
-
-// CHECK-LABEL: @compare_exchange
-#[no_mangle]
-pub fn compare_exchange(a: &AtomicI32) {
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 10 monotonic monotonic
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 11 acquire acquire
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 12 seq_cst seq_cst
-    let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
-    let _ = a.compare_exchange(0, 11, Relaxed, Acquire);
-    let _ = a.compare_exchange(0, 12, Relaxed, SeqCst);
-
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 20 release monotonic
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 21 acq_rel acquire
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 22 seq_cst seq_cst
-    let _ = a.compare_exchange(0, 20, Release, Relaxed);
-    let _ = a.compare_exchange(0, 21, Release, Acquire);
-    let _ = a.compare_exchange(0, 22, Release, SeqCst);
-
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 30 acquire monotonic
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 31 acquire acquire
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 32 seq_cst seq_cst
-    let _ = a.compare_exchange(0, 30, Acquire, Relaxed);
-    let _ = a.compare_exchange(0, 31, Acquire, Acquire);
-    let _ = a.compare_exchange(0, 32, Acquire, SeqCst);
-
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 40 acq_rel monotonic
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 41 acq_rel acquire
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 42 seq_cst seq_cst
-    let _ = a.compare_exchange(0, 40, AcqRel, Relaxed);
-    let _ = a.compare_exchange(0, 41, AcqRel, Acquire);
-    let _ = a.compare_exchange(0, 42, AcqRel, SeqCst);
-
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 50 seq_cst monotonic
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 51 seq_cst acquire
-    // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 52 seq_cst seq_cst
-    let _ = a.compare_exchange(0, 50, SeqCst, Relaxed);
-    let _ = a.compare_exchange(0, 51, SeqCst, Acquire);
-    let _ = a.compare_exchange(0, 52, SeqCst, SeqCst);
-}
-
-// CHECK-LABEL: @compare_exchange_weak
-#[no_mangle]
-pub fn compare_exchange_weak(w: &AtomicI32) {
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 10 monotonic monotonic
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 11 acquire acquire
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 12 seq_cst seq_cst
-    let _ = w.compare_exchange_weak(1, 10, Relaxed, Relaxed);
-    let _ = w.compare_exchange_weak(1, 11, Relaxed, Acquire);
-    let _ = w.compare_exchange_weak(1, 12, Relaxed, SeqCst);
-
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 20 release monotonic
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 21 acq_rel acquire
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 22 seq_cst seq_cst
-    let _ = w.compare_exchange_weak(1, 20, Release, Relaxed);
-    let _ = w.compare_exchange_weak(1, 21, Release, Acquire);
-    let _ = w.compare_exchange_weak(1, 22, Release, SeqCst);
-
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 30 acquire monotonic
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 31 acquire acquire
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 32 seq_cst seq_cst
-    let _ = w.compare_exchange_weak(1, 30, Acquire, Relaxed);
-    let _ = w.compare_exchange_weak(1, 31, Acquire, Acquire);
-    let _ = w.compare_exchange_weak(1, 32, Acquire, SeqCst);
-
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 40 acq_rel monotonic
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 41 acq_rel acquire
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 42 seq_cst seq_cst
-    let _ = w.compare_exchange_weak(1, 40, AcqRel, Relaxed);
-    let _ = w.compare_exchange_weak(1, 41, AcqRel, Acquire);
-    let _ = w.compare_exchange_weak(1, 42, AcqRel, SeqCst);
-
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 50 seq_cst monotonic
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 51 seq_cst acquire
-    // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 52 seq_cst seq_cst
-    let _ = w.compare_exchange_weak(1, 50, SeqCst, Relaxed);
-    let _ = w.compare_exchange_weak(1, 51, SeqCst, Acquire);
-    let _ = w.compare_exchange_weak(1, 52, SeqCst, SeqCst);
-}
index 771cf58725aaa7e4d7b36afd9f3483d363e3af2c..d2bc618dfc528f35318a093ee892b6e421c2b26c 100644 (file)
@@ -1,5 +1,4 @@
 // Code generation of atomic operations.
-// min-llvm-version: 13.0
 // compile-flags: -O
 #![crate_type = "lib"]
 
index b23073778c0b5c5664880d70d2484e06e9d9332f..994c71b261982e599b51721d8134f04aea4878dc 100644 (file)
@@ -1,7 +1,6 @@
 // Test that the correct module flags are emitted with different branch protection flags.
 
 // revisions: BTI PACRET LEAF BKEY NONE
-// min-llvm-version: 12.0.0
 // needs-llvm-components: aarch64
 // [BTI] compile-flags: -Z branch-protection=bti
 // [PACRET] compile-flags: -Z branch-protection=pac-ret
index d6caeeee8966985e54e7f46d6fb350600068e581..8e8fe5c964d3c9b15f8895b7ed5c5d13636e6ad1 100644 (file)
@@ -1,3 +1,4 @@
+// min-llvm-version: 14.0
 // revisions: O Os
 //[Os] compile-flags: -Copt-level=s
 //[O] compile-flags: -O
index 8201d54348a839fa4c09f6648350bb95fe9a581c..ad8f9398e7f3c06237103c385fef64ca7c34e39b 100644 (file)
@@ -1,7 +1,6 @@
 //! Tests that unwinding from an asm block is caught and forced to abort
 //! when `-C panic=abort`.
 
-// min-llvm-version: 13.0.0
 // only-x86_64
 // compile-flags: -C panic=abort
 // no-prefer-dynamic
index ac8cc62027e4aa403ac7aacfd952466bb574661c..dfd891b4212d53eb2fdfc527d44541d2cf4d4486 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
 // only-aarch64
 // run-pass
 // needs-asm-support
index 117c0a63aa4b943f4c8c36f90437135c5d50ddcc..b9479c44bf11d7ab4a93d2b95364c053938cc097 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
 // run-pass
 // needs-asm-support
 
index 9844d63f0cd43653c5e0ebf110f00043ec7565e0..badc4fec82248cc09dfb0983a13485799163b467 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
 // only-x86_64
 // run-pass
 // needs-asm-support
index 622365bc712af15d22d86fdd823783ba547309e6..447e11e6eabcae9abc64b54db92371ce4dfe7886 100644 (file)
@@ -1,4 +1,3 @@
-// min-llvm-version: 12.0.1
 // only-x86_64
 // only-linux
 // needs-asm-support
index f7513b6b8f447e3bfad0fe0fc1820459dbccb34b..8a4ff16694bdb0c787c4f389bc356b4d9d9eb852 100644 (file)
@@ -1,5 +1,4 @@
 // run-pass
-// min-llvm-version: 13.0
 // compile-flags: -O
 
 // Regression test for issue #80309
index 5c0f4b76ceb3a9871c7792b3c4c428595aa14849..c13ce3c9cd2c1d2f21e677cbf412efd03e246ccf 100644 (file)
@@ -1,5 +1,4 @@
 // run-pass
-// min-llvm-version: 13.0
 // compile-flags: -O
 
 // Regression test for issue #80309