Skip to content

Commit e11e2b4

Browse files
compiler: internally merge Conv::PtxKernel into GpuKernel
It is speculated that these two can be conceptually merged, and it can start by ripping out rustc's notion of the PtxKernel call convention. Leave the ExternAbi for now, but the nvptx target now should see it as just a different way to spell Conv::GpuKernel.
1 parent 124cc92 commit e11e2b4

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ impl llvm::CallConv {
687687
Conv::AvrNonBlockingInterrupt => llvm::AvrNonBlockingInterrupt,
688688
Conv::ArmAapcs => llvm::ArmAapcsCallConv,
689689
Conv::Msp430Intr => llvm::Msp430Intr,
690-
Conv::PtxKernel => llvm::PtxKernel,
691690
Conv::X86Fastcall => llvm::X86FastcallCallConv,
692691
Conv::X86Intr => llvm::X86_Intr,
693692
Conv::X86Stdcall => llvm::X86StdcallCallConv,

compiler/rustc_smir/src/rustc_smir/convert/abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl<'tcx> Stable<'tcx> for callconv::Conv {
105105
Conv::CCmseNonSecureCall => CallConvention::CCmseNonSecureCall,
106106
Conv::CCmseNonSecureEntry => CallConvention::CCmseNonSecureEntry,
107107
Conv::Msp430Intr => CallConvention::Msp430Intr,
108-
Conv::PtxKernel => CallConvention::PtxKernel,
109108
Conv::X86Fastcall => CallConvention::X86Fastcall,
110109
Conv::X86Intr => CallConvention::X86Intr,
111110
Conv::X86Stdcall => CallConvention::X86Stdcall,

compiler/rustc_target/src/callconv/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ pub enum Conv {
543543

544544
Msp430Intr,
545545

546-
PtxKernel,
547-
548546
GpuKernel,
549547

550548
X86Fastcall,
@@ -701,7 +699,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
701699
"sparc" => sparc::compute_abi_info(cx, self),
702700
"sparc64" => sparc64::compute_abi_info(cx, self),
703701
"nvptx64" => {
704-
if cx.target_spec().adjust_abi(abi, self.c_variadic) == ExternAbi::PtxKernel {
702+
let abi = cx.target_spec().adjust_abi(abi, self.c_variadic);
703+
if abi == ExternAbi::PtxKernel || abi == ExternAbi::GpuKernel {
705704
nvptx64::compute_ptx_kernel_abi_info(cx, self)
706705
} else {
707706
nvptx64::compute_abi_info(self)
@@ -860,7 +859,6 @@ impl FromStr for Conv {
860859
"CCmseNonSecureCall" => Ok(Conv::CCmseNonSecureCall),
861860
"CCmseNonSecureEntry" => Ok(Conv::CCmseNonSecureEntry),
862861
"Msp430Intr" => Ok(Conv::Msp430Intr),
863-
"PtxKernel" => Ok(Conv::PtxKernel),
864862
"X86Fastcall" => Ok(Conv::X86Fastcall),
865863
"X86Intr" => Ok(Conv::X86Intr),
866864
"X86Stdcall" => Ok(Conv::X86Stdcall),

compiler/rustc_target/src/json.rs

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl ToJson for crate::callconv::Conv {
105105
Self::CCmseNonSecureCall => "CCmseNonSecureCall",
106106
Self::CCmseNonSecureEntry => "CCmseNonSecureEntry",
107107
Self::Msp430Intr => "Msp430Intr",
108-
Self::PtxKernel => "PtxKernel",
109108
Self::X86Fastcall => "X86Fastcall",
110109
Self::X86Intr => "X86Intr",
111110
Self::X86Stdcall => "X86Stdcall",

compiler/rustc_ty_utils/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn conv_from_spec_abi(tcx: TyCtxt<'_>, abi: ExternAbi, c_variadic: bool) -> Conv
290290
Aapcs { .. } => Conv::ArmAapcs,
291291
CCmseNonSecureCall => Conv::CCmseNonSecureCall,
292292
CCmseNonSecureEntry => Conv::CCmseNonSecureEntry,
293-
PtxKernel => Conv::PtxKernel,
293+
PtxKernel => Conv::GpuKernel,
294294
Msp430Interrupt => Conv::Msp430Intr,
295295
X86Interrupt => Conv::X86Intr,
296296
GpuKernel => Conv::GpuKernel,

0 commit comments

Comments
 (0)