Auto merge of #120055 - nikic:llvm-18, r=cuviper · rust-lang/rust@eaff1af (original) (raw)

File tree

9 files changed

lines changed

9 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
33 33 [submodule "src/llvm-project"]
34 34 path = src/llvm-project
35 35 url = https://github.com/rust-lang/llvm-project.git
36 -branch = rustc/17.0-2023-12-14
36 +branch = rustc/18.0-2024-02-13
37 37 shallow = true
38 38 [submodule "src/doc/embedded-book"]
39 39 path = src/doc/embedded-book
Original file line number Diff line number Diff line change
@@ -747,9 +747,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
747 747
748 748 [[package]]
749 749 name = "compiler_builtins"
750 -version = "0.1.105"
750 +version = "0.1.108"
751 751 source = "registry+https://github.com/rust-lang/crates.io-index"
752 -checksum = "3686cc48897ce1950aa70fd595bd2dc9f767a3c4cca4cd17b2cb52a2d37e6eb4"
752 +checksum = "d68bc55329711cd719c2687bb147bc06211b0521f97ef398280108ccb23227e9"
753 753 dependencies = [
754 754 "cc",
755 755 "rustc-std-workspace-core",
Original file line number Diff line number Diff line change
@@ -371,10 +371,10 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
371 371 }
372 372
373 373 extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
374 -#ifdef LLVM_RUSTLLVM
374 +#if LLVM_VERSION_GE(18, 0)
375 375 const TargetMachine *Target = unwrap(TM);
376 376 const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
377 -const ArrayRef FeatTable = MCInfo->getFeatureTable();
377 +const ArrayRef FeatTable = MCInfo->getAllProcessorFeatures();
378 378 return FeatTable.size();
379 379 #else
380 380 return 0;
@@ -383,10 +383,10 @@ extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
383 383
384 384 extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index,
385 385 const char** Feature, const char** Desc) {
386 -#ifdef LLVM_RUSTLLVM
386 +#if LLVM_VERSION_GE(18, 0)
387 387 const TargetMachine *Target = unwrap(TM);
388 388 const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
389 -const ArrayRef FeatTable = MCInfo->getFeatureTable();
389 +const ArrayRef FeatTable = MCInfo->getAllProcessorFeatures();
390 390 const SubtargetFeatureKV Feat = FeatTable[Index];
391 391 *Feature = Feat.Key;
392 392 *Desc = Feat.Desc;
Original file line number Diff line number Diff line change
@@ -412,9 +412,7 @@ impl Step for Llvm {
412 412 }
413 413
414 414 if target.is_msvc() {
415 - cfg.define("LLVM_USE_CRT_DEBUG", "MT");
416 - cfg.define("LLVM_USE_CRT_RELEASE", "MT");
417 - cfg.define("LLVM_USE_CRT_RELWITHDEBINFO", "MT");
415 + cfg.define("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded");
418 416 cfg.static_crt(true);
419 417 }
420 418
Original file line number Diff line number Diff line change
@@ -134,6 +134,8 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
134 134 CFLAGS_riscv32imc_unknown_none_elf=-march=rv32imc -mabi=ilp32 \
135 135 CC_riscv32imac_unknown_none_elf=riscv32-unknown-elf-gcc \
136 136 CFLAGS_riscv32imac_unknown_none_elf=-march=rv32imac -mabi=ilp32 \
137 + CC_riscv32imafc_unknown_none_elf=riscv32-unknown-elf-gcc \
138 + CFLAGS_riscv32imafc_unknown_none_elf=-march=rv32imafc -mabi=ilp32 \
137 139 CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc \
138 140 CFLAGS_riscv64imac_unknown_none_elf=-march=rv64imac -mabi=lp64 \
139 141 CC_riscv64gc_unknown_none_elf=riscv64-unknown-elf-gcc \
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T
59 59 tests/codegen \
60 60 tests/assembly \
61 61 library/core
62 +ENV CC_wasm32_unknown_unknown=clang-11
62 63
63 64 ENV NVPTX_TARGETS=nvptx64-nvidia-cuda
64 65 ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ FROM ubuntu:22.04
3 3 ARG DEBIAN_FRONTEND=noninteractive
4 4 RUN apt-get update && apt-get install -y --no-install-recommends \
5 5 build-essential \
6 + clang-15 \
6 7 g++ \
7 8 make \
8 9 ninja-build \
@@ -46,6 +47,9 @@ ENV TARGETS=x86_64-fuchsia
46 47 ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnu
47 48 ENV TARGETS=$TARGETS,wasm32-unknown-unknown
48 49
50 +# Fuchsia clang does not have wasm target enabled, use system clang.
51 +ENV CC_wasm32_unknown_unknown=clang-15
52 +
49 53 COPY scripts/sccache.sh /scripts/
50 54 RUN sh /scripts/sccache.sh
51 55
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ pub fn iter_repeat_n_next(it: &mut std::iter::RepeatN) -> Option<NotCop
47 47 #[no_mangle]
48 48 // CHECK-LABEL: @vec_extend_via_iter_repeat_n
49 49 pub fn vec_extend_via_iter_repeat_n() -> Vec<u8> {
50 -// CHECK: %[[ADDR:.+]] = tail call noundef dereferenceable_or_null(1234) ptr @__rust_alloc(i64 noundef 1234, i64 noundef 1)
50 +// CHECK: %[[ADDR:.+]] = tail call {{(noalias )?}}noundef dereferenceable_or_null(1234) ptr @__rust_alloc(i64 noundef 1234, i64 noundef 1)
51 51 // CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR]], i8 42, i64 1234,
52 52
53 53 let n = 1234_usize;