Notification time stamped 2023-09-01 00:09:28 UTC
From 27b7401a74bc6ed00e8b63641279df481be0399b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Aug 31 2023 23:57:59 +0000
Subject: Revert a MIR inlining change for ppc64le
---
diff --git a/0001-Revert-Ignore-the-always-part-of-inline-always-in-MI.patch
b/0001-Revert-Ignore-the-always-part-of-inline-always-in-MI.patch
new file mode 100644
index 0000000..d0a2c03
--- /dev/null
+++ b/0001-Revert-Ignore-the-always-part-of-inline-always-in-MI.patch
@@ -0,0 +1,41 @@
+From b7bf16f803f7913cb1c942133d3f31053c79ad9a Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone(a)redhat.com>
+Date: Thu, 31 Aug 2023 13:37:23 -0700
+Subject: [PATCH] Revert "Ignore the always part of #[inline(always)] in MIR
+ inlining"
+
+This reverts part of commit c153f3a356b0e7917c91d3a804b93fadffb778b0.
+
+On Fedora 37 with LLVM 15, we were seeing strange errors from the stage2
+rustc on ppc64le, which seemed to imply bad codegen in rustc itself. Git
+bisect pointed to this MIR inlining change -- it's not likely the root
+cause, since later Fedora with LLVM 16 is working, but this will unblock
+us for now.
+---
+ compiler/rustc_mir_transform/src/inline.rs | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/compiler/rustc_mir_transform/src/inline.rs
b/compiler/rustc_mir_transform/src/inline.rs
+index b6578cb259ac..8939a26f2ab9 100644
+--- a/compiler/rustc_mir_transform/src/inline.rs
++++ b/compiler/rustc_mir_transform/src/inline.rs
+@@ -483,12 +483,11 @@ fn check_mir_body(
+ // Abort if type validation found anything fishy.
+ checker.validation?;
+
+- // N.B. We still apply our cost threshold to #[inline(always)] functions.
+- // That attribute is often applied to very large functions that exceed
LLVM's (very
+- // generous) inlining threshold. Such functions are very poor MIR inlining
candidates.
+- // Always inlining #[inline(always)] functions in MIR, on net, slows down the
compiler.
+ let cost = checker.cost;
+- if cost <= threshold {
++ if let InlineAttr::Always = callee_attrs.inline {
++ debug!("INLINING {:?} because inline(always) [cost={}]", callsite,
cost);
++ Ok(())
++ } else if cost <= threshold {
+ debug!("INLINING {:?} [cost={} <= threshold={}]", callsite,
cost, threshold);
+ Ok(())
+ } else {
+--
+2.41.0
+
diff --git a/rust.spec b/rust.spec
index de93f40..dd01c45 100644
--- a/rust.spec
+++ b/rust.spec
@@ -123,6 +123,9 @@ Patch5:
0001-Don-t-fail-early-if-try_run-returns-an-error.patch
#
https://github.com/rust-lang/rust/pull/115109
Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch
+# Revert a MIR inlining change that broke ppc64le with LLVM 15.
+Patch7: 0001-Revert-Ignore-the-always-part-of-inline-always-in-MI.patch
+
### RHEL-specific patches below ###
# Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -600,6 +603,7 @@ test -f '%{local_rust_root}/bin/rustc'
%patch -P4 -p1
%patch -P5 -p1
%patch -P6 -p1
+%patch -P7 -p1
%if %with disabled_libssh2
%patch -P100 -p1
https://src.fedoraproject.org/rpms/rust/c/27b7401a74bc6ed00e8b63641279df4...