diff options
| author | bors <bors@rust-lang.org> | 2022-06-07 08:12:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-07 08:12:45 +0000 |
| commit | 91cacb3faf987805675e39aca41859ec1fcabef3 (patch) | |
| tree | 8abbf8d38127f75c7a19f5564b0a6db0b65e29a1 /compiler/rustc_target/src | |
| parent | bb55bd449e65e611da928560d948982d73e50027 (diff) | |
| parent | be4e0898ccf4f6514a94c3b89ab48bd3a8268ce3 (diff) | |
| download | rust-91cacb3faf987805675e39aca41859ec1fcabef3.tar.gz rust-91cacb3faf987805675e39aca41859ec1fcabef3.zip | |
Auto merge of #97512 - scottmcm:add-coldcc, r=nagisa,lcnr
Add support for emitting functions with `coldcc` to LLVM The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/abi/call/mod.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/abi.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index afce10ff1cb..ca1d1302ec6 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -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, diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs index d9e571c72e5..337554dc96e 100644 --- a/compiler/rustc_target/src/spec/abi.rs +++ b/compiler/rustc_target/src/spec/abi.rs @@ -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 diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 0f5db8982e8..4ede0677ab3 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1620,7 +1620,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[..]), |
