Skip to content

Commit eaff1af

Browse files
committed
Auto merge of #120055 - nikic:llvm-18, r=cuviper
Update to LLVM 18 LLVM 18 final is planned to be released on Mar 5th. Rust 1.78 is planned to be released on May 2nd. Tested images: dist-x86_64-linux, dist-s390x-linux, dist-aarch64-linux, dist-riscv64-linux, dist-loongarch64-linux, dist-x86_64-freebsd, dist-x86_64-illumos, dist-x86_64-musl, x86_64-linux-integration, test-various, armhf-gnu, i686-msvc, x86_64-msvc, i686-mingw, x86_64-mingw, x86_64-apple-1, x86_64-apple-2, dist-aarch64-apple r? `@ghost`
2 parents bc1b9e0 + a6ee72d commit eaff1af

File tree

9 files changed

+17
-12
lines changed

9 files changed

+17
-12
lines changed

Diff for: .gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
3535
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
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

Diff for: Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
747747

748748
[[package]]
749749
name = "compiler_builtins"
750-
version = "0.1.105"
750+
version = "0.1.108"
751751
source = "registry+https://github.com/rust-lang/crates.io-index"
752-
checksum = "3686cc48897ce1950aa70fd595bd2dc9f767a3c4cca4cd17b2cb52a2d37e6eb4"
752+
checksum = "d68bc55329711cd719c2687bb147bc06211b0521f97ef398280108ccb23227e9"
753753
dependencies = [
754754
"cc",
755755
"rustc-std-workspace-core",

Diff for: compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
371371
}
372372

373373
extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
374-
#ifdef LLVM_RUSTLLVM
374+
#if LLVM_VERSION_GE(18, 0)
375375
const TargetMachine *Target = unwrap(TM);
376376
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
377-
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
377+
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures();
378378
return FeatTable.size();
379379
#else
380380
return 0;
@@ -383,10 +383,10 @@ extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
383383

384384
extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index,
385385
const char** Feature, const char** Desc) {
386-
#ifdef LLVM_RUSTLLVM
386+
#if LLVM_VERSION_GE(18, 0)
387387
const TargetMachine *Target = unwrap(TM);
388388
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
389-
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
389+
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures();
390390
const SubtargetFeatureKV Feat = FeatTable[Index];
391391
*Feature = Feat.Key;
392392
*Desc = Feat.Desc;

Diff for: src/bootstrap/src/core/build_steps/llvm.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,7 @@ impl Step for Llvm {
412412
}
413413

414414
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");
418416
cfg.static_crt(true);
419417
}
420418

Diff for: src/ci/docker/host-x86_64/dist-various-1/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft
134134
CFLAGS_riscv32imc_unknown_none_elf=-march=rv32imc -mabi=ilp32 \
135135
CC_riscv32imac_unknown_none_elf=riscv32-unknown-elf-gcc \
136136
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 \
137139
CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc \
138140
CFLAGS_riscv64imac_unknown_none_elf=-march=rv64imac -mabi=lp64 \
139141
CC_riscv64gc_unknown_none_elf=riscv64-unknown-elf-gcc \

Diff for: src/ci/docker/host-x86_64/test-various/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T
5959
tests/codegen \
6060
tests/assembly \
6161
library/core
62+
ENV CC_wasm32_unknown_unknown=clang-11
6263

6364
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda
6465
ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-integration/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM ubuntu:22.04
33
ARG DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get install -y --no-install-recommends \
55
build-essential \
6+
clang-15 \
67
g++ \
78
make \
89
ninja-build \
@@ -46,6 +47,9 @@ ENV TARGETS=x86_64-fuchsia
4647
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnu
4748
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
4849

50+
# Fuchsia clang does not have wasm target enabled, use system clang.
51+
ENV CC_wasm32_unknown_unknown=clang-15
52+
4953
COPY scripts/sccache.sh /scripts/
5054
RUN sh /scripts/sccache.sh
5155

Diff for: src/llvm-project

Diff for: tests/codegen/iter-repeat-n-trivial-drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn iter_repeat_n_next(it: &mut std::iter::RepeatN<NotCopy>) -> Option<NotCop
4747
#[no_mangle]
4848
// CHECK-LABEL: @vec_extend_via_iter_repeat_n
4949
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)
5151
// CHECK: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1234) %[[ADDR]], i8 42, i64 1234,
5252

5353
let n = 1234_usize;

0 commit comments

Comments
 (0)