diff options
| author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2022-02-26 12:52:07 -0500 |
|---|---|---|
| committer | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2022-02-27 23:11:03 -0500 |
| commit | 851fcc7a54262748b1aa9e16de91453998d896f3 (patch) | |
| tree | b4d47e400cc99387bb3a43c9a3d2e86e4a26b537 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 3b1fe7e7c95e14dd8a420edf2f8a160c70211e04 (diff) | |
| download | rust-851fcc7a54262748b1aa9e16de91453998d896f3.tar.gz rust-851fcc7a54262748b1aa9e16de91453998d896f3.zip | |
Revert "Auto merge of #92419 - erikdesjardins:coldland, r=nagisa"
This reverts commit 4f49627c6fe2a32d1fed6310466bb0e1c535c0c0, reversing changes made to 028c6f1454787c068ff5117e9000a1de4fd98374.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 5e78d6fc851..3703e902bb7 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -23,7 +23,6 @@ use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_span::Span; use rustc_target::abi::{self, call::FnAbi, Align, Size, WrappingRange}; use rustc_target::spec::{HasTargetSpec, Target}; -use smallvec::SmallVec; use std::borrow::Cow; use std::ffi::CStr; use std::iter; @@ -1175,19 +1174,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { unsafe { llvm::LLVMBuildZExt(self.llbuilder, val, dest_ty, UNNAMED) } } - fn apply_attrs_to_cleanup_callsite(&mut self, llret: &'ll Value) { - let mut attrs = SmallVec::<[_; 2]>::new(); - - // Cleanup is always the cold path. - attrs.push(llvm::AttributeKind::Cold.create_attr(self.llcx)); - - // In LLVM versions with deferred inlining (currently, system LLVM < 14), - // inlining drop glue can lead to exponential size blowup, see #41696 and #92110. - if !llvm_util::is_rust_llvm() && llvm_util::get_version() < (14, 0, 0) { - attrs.push(llvm::AttributeKind::NoInline.create_attr(self.llcx)); - } - - attributes::apply_to_callsite(llret, llvm::AttributePlace::Function, &attrs); + fn do_not_inline(&mut self, llret: &'ll Value) { + let noinline = llvm::AttributeKind::NoInline.create_attr(self.llcx); + attributes::apply_to_callsite(llret, llvm::AttributePlace::Function, &[noinline]); } } |
