Skip to content

Commit bcc3997

Browse files
committed
Auto merge of rust-lang#120055 - nikic:llvm-18, r=<try>
Update to LLVM 18 Blocked on rust-lang#120376. Blocked on rust-lang/compiler-builtins#564. LLVM 18 final is planned to be released on Mar 5th. Rust 1.77 is planned to be released on Mar 21st. Tested images: dist-x86_64-linux, dist-s390x-linux, dist-aarch64-linux, dist-riscv64-linux, dist-x86_64-freebsd, dist-x86_64-illumos x86_64-linux-integration, test-various, armhf-gnu r? `@ghost`
2 parents 1fc46f3 + c57f99e commit bcc3997

File tree

8 files changed

+67
-19
lines changed

8 files changed

+67
-19
lines changed

.github/workflows/ci.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,30 @@ jobs:
567567
strategy:
568568
matrix:
569569
include:
570-
- name: dist-x86_64-linux
570+
- name: x86_64-msvc
571571
env:
572-
CODEGEN_BACKENDS: "llvm,cranelift"
573-
os: ubuntu-20.04-16core-64gb
572+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
573+
SCRIPT: make ci-msvc
574+
os: windows-2019-8core-32gb
575+
- name: i686-msvc
576+
env:
577+
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
578+
SCRIPT: make ci-msvc
579+
os: windows-2019-8core-32gb
580+
- name: i686-mingw
581+
env:
582+
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
583+
SCRIPT: make ci-mingw
584+
NO_DOWNLOAD_CI_LLVM: 1
585+
CUSTOM_MINGW: 1
586+
os: windows-2019-8core-32gb
587+
- name: x86_64-mingw
588+
env:
589+
SCRIPT: make ci-mingw
590+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
591+
NO_DOWNLOAD_CI_LLVM: 1
592+
CUSTOM_MINGW: 1
593+
os: windows-2019-8core-32gb
574594
timeout-minutes: 600
575595
runs-on: "${{ matrix.os }}"
576596
steps:

.gitmodules

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
shallow = true
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
35-
url = https://github.com/rust-lang/llvm-project.git
36-
branch = rustc/17.0-2023-12-14
35+
url = https://github.com/nikic/llvm-project.git
36+
branch = rust-llvm-18
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

Cargo.lock

+2-3
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,8 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
723723

724724
[[package]]
725725
name = "compiler_builtins"
726-
version = "0.1.105"
727-
source = "registry+https://github.com/rust-lang/crates.io-index"
728-
checksum = "3686cc48897ce1950aa70fd595bd2dc9f767a3c4cca4cd17b2cb52a2d37e6eb4"
726+
version = "0.1.106"
727+
source = "git+https://github.com/nikic/compiler-builtins.git?branch=cpu-model-moved#ae3ba6e1b9ec6cacb0c4aad7e1e6d76481265bf9"
729728
dependencies = [
730729
"cc",
731730
"rustc-std-workspace-core",

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,7 @@ rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
119119
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
120120
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
121121

122+
compiler_builtins = { git = "https://github.com/nikic/compiler-builtins.git", branch = "cpu-model-moved" }
123+
122124
[patch."https://github.com/rust-lang/rust-clippy"]
123125
clippy_lints = { path = "src/tools/clippy/clippy_lints" }

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
368368
}
369369

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

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

src/ci/github-actions/ci.yml

+31-4
Original file line numberDiff line numberDiff line change
@@ -724,12 +724,39 @@ jobs:
724724
strategy:
725725
matrix:
726726
include:
727-
- &dist-x86_64-linux
728-
name: dist-x86_64-linux
727+
- name: x86_64-msvc
729728
env:
730-
CODEGEN_BACKENDS: llvm,cranelift
731-
<<: *job-linux-16c
729+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
730+
SCRIPT: make ci-msvc
731+
<<: *job-windows-8c
732+
733+
- name: i686-msvc
734+
env:
735+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
736+
SCRIPT: make ci-msvc
737+
<<: *job-windows-8c
732738

739+
- name: i686-mingw
740+
env:
741+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
742+
SCRIPT: make ci-mingw
743+
# We are intentionally allowing an old toolchain on this builder (and that's
744+
# incompatible with LLVM downloads today).
745+
NO_DOWNLOAD_CI_LLVM: 1
746+
CUSTOM_MINGW: 1
747+
<<: *job-windows-8c
748+
749+
- name: x86_64-mingw
750+
env:
751+
SCRIPT: make ci-mingw
752+
RUST_CONFIGURE_ARGS: >-
753+
--build=x86_64-pc-windows-gnu
754+
--enable-profiler
755+
# We are intentionally allowing an old toolchain on this builder (and that's
756+
# incompatible with LLVM downloads today).
757+
NO_DOWNLOAD_CI_LLVM: 1
758+
CUSTOM_MINGW: 1
759+
<<: *job-windows-8c
733760

734761
master:
735762
name: master

src/llvm-project

tests/codegen/pow_of_two.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#[no_mangle]
55
pub fn a(exp: u32) -> u64 {
66
// CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 64
7-
// CHECK: %{{[^ ]+}} = zext i32 %exp to i64
7+
// CHECK: %{{[^ ]+}} = zext{{( nneg)?}} i32 %exp to i64
88
// CHECK: %{{[^ ]+}} = shl nuw i64 {{[^ ]+}}, %{{[^ ]+}}
99
// CHECK: ret i64 %{{[^ ]+}}
1010
2u64.pow(exp)
@@ -14,7 +14,7 @@ pub fn a(exp: u32) -> u64 {
1414
#[no_mangle]
1515
pub fn b(exp: u32) -> i64 {
1616
// CHECK: %{{[^ ]+}} = icmp ugt i32 %exp, 64
17-
// CHECK: %{{[^ ]+}} = zext i32 %exp to i64
17+
// CHECK: %{{[^ ]+}} = zext{{( nneg)?}} i32 %exp to i64
1818
// CHECK: %{{[^ ]+}} = shl nuw i64 {{[^ ]+}}, %{{[^ ]+}}
1919
// CHECK: ret i64 %{{[^ ]+}}
2020
2i64.pow(exp)

0 commit comments

Comments
 (0)