Add support for emitting functions with coldcc in LLVM
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
This commit is contained in:
@@ -580,6 +580,11 @@ pub enum Conv {
|
||||
C,
|
||||
Rust,
|
||||
|
||||
/// For things unlikely to be called, where smaller caller codegen is
|
||||
/// preferred over raw speed.
|
||||
/// Stronger than just `#[cold]` because `fn` pointers might be incompatible.
|
||||
RustCold,
|
||||
|
||||
// Target-specific calling conventions.
|
||||
ArmAapcs,
|
||||
CCmseNonSecureCall,
|
||||
|
||||
@@ -35,6 +35,7 @@ pub enum Abi {
|
||||
RustCall,
|
||||
PlatformIntrinsic,
|
||||
Unadjusted,
|
||||
RustCold,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
@@ -81,6 +82,7 @@ const AbiDatas: &[AbiData] = &[
|
||||
AbiData { abi: Abi::RustCall, name: "rust-call" },
|
||||
AbiData { abi: Abi::PlatformIntrinsic, name: "platform-intrinsic" },
|
||||
AbiData { abi: Abi::Unadjusted, name: "unadjusted" },
|
||||
AbiData { abi: Abi::RustCold, name: "rust-cold" },
|
||||
];
|
||||
|
||||
/// Returns the ABI with the given name (if any).
|
||||
@@ -139,6 +141,7 @@ impl Abi {
|
||||
RustCall => 31,
|
||||
PlatformIntrinsic => 32,
|
||||
Unadjusted => 33,
|
||||
RustCold => 34,
|
||||
};
|
||||
debug_assert!(
|
||||
AbiDatas
|
||||
|
||||
@@ -1618,7 +1618,8 @@ impl Target {
|
||||
| PlatformIntrinsic
|
||||
| Unadjusted
|
||||
| Cdecl { .. }
|
||||
| EfiApi => true,
|
||||
| EfiApi
|
||||
| RustCold => true,
|
||||
X86Interrupt => ["x86", "x86_64"].contains(&&self.arch[..]),
|
||||
Aapcs { .. } => "arm" == self.arch,
|
||||
CCmseNonSecureCall => ["arm", "aarch64"].contains(&&self.arch[..]),
|
||||
|
||||
Reference in New Issue
Block a user