Skip to content

Commit c728d1f

Browse files
committed
Revert "Auto merge of rust-lang#114048 - nikic:llvm-17, r=cuviper"
This reverts commit 443c316, reversing changes made to 03a119b.
1 parent e7f9f48 commit c728d1f

24 files changed

+26
-37
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
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-07-29
36+
branch = rustc/16.0-2023-06-05
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,6 @@ pub unsafe fn create_module<'ll>(
146146
target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
147147
}
148148
}
149-
if llvm_version < (17, 0, 0) {
150-
if sess.target.arch.starts_with("powerpc") {
151-
// LLVM 17 specifies function pointer alignment for ppc:
152-
// https://reviews.llvm.org/D147016
153-
target_data_layout = target_data_layout
154-
.replace("-Fn32", "")
155-
.replace("-Fi32", "")
156-
.replace("-Fn64", "")
157-
.replace("-Fi64", "");
158-
}
159-
}
160149

161150
// Ensure the data-layout values hardcoded remain the defaults.
162151
if sess.target.is_builtin {

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
333333
#if LLVM_VERSION_GE(17, 0)
334334
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
335335
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getAllProcessorDescriptions();
336+
#elif defined(LLVM_RUSTLLVM)
337+
const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable();
336338
#else
337339
Buf << "Full target CPU help is not supported by this LLVM version.\n\n";
338340
SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} };
@@ -1199,7 +1201,7 @@ struct LLVMRustThinLTOData {
11991201

12001202
// Not 100% sure what these are, but they impact what's internalized and
12011203
// what's inlined across modules, I believe.
1202-
#if LLVM_VERSION_GE(18, 0)
1204+
#if LLVM_VERSION_GE(17, 0)
12031205
DenseMap<StringRef, FunctionImporter::ImportMapTy> ImportLists;
12041206
DenseMap<StringRef, FunctionImporter::ExportSetTy> ExportLists;
12051207
DenseMap<StringRef, GVSummaryMapTy> ModuleToDefinedGVSummaries;

compiler/rustc_target/src/spec/powerpc64_ibm_aix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-ibm-aix".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
14+
data_layout: "E-m:a-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
1515
arch: "powerpc64".into(),
1616
options: base,
1717
}

compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-unknown-freebsd".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:e-Fn32-i64:64-n32:64".into(),
14+
data_layout: "E-m:e-i64:64-n32:64".into(),
1515
arch: "powerpc64".into(),
1616
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
1717
}

compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-unknown-linux-gnu".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
14+
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
1515
arch: "powerpc64".into(),
1616
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
1717
}

compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-unknown-linux-musl".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
14+
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
1515
arch: "powerpc64".into(),
1616
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
1717
}

compiler/rustc_target/src/spec/powerpc64_unknown_openbsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-unknown-openbsd".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:e-Fn32-i64:64-n32:64".into(),
14+
data_layout: "E-m:e-i64:64-n32:64".into(),
1515
arch: "powerpc64".into(),
1616
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
1717
}

compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn target() -> Target {
1111
Target {
1212
llvm_target: "powerpc64-unknown-linux-gnu".into(),
1313
pointer_width: 64,
14-
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
14+
data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),
1515
arch: "powerpc64".into(),
1616
options: TargetOptions { endian: Endian::Big, ..base },
1717
}

compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn target() -> Target {
1010
Target {
1111
llvm_target: "powerpc64le-unknown-freebsd".into(),
1212
pointer_width: 64,
13-
data_layout: "e-m:e-Fn32-i64:64-n32:64".into(),
13+
data_layout: "e-m:e-i64:64-n32:64".into(),
1414
arch: "powerpc64".into(),
1515
options: TargetOptions { mcount: "_mcount".into(), ..base },
1616
}

0 commit comments

Comments
 (0)