NVPTX: Allow PassMode::Direct for ptx kernels for now

This commit is contained in:
Kjetil Kjeka 2023-10-26 21:43:43 +02:00 committed by Kjetil Kjeka
parent 8396efecf7
commit 84c9c4aca7

View File

@ -362,8 +362,13 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
// currently use this mode so we have to allow it -- but we absolutely // currently use this mode so we have to allow it -- but we absolutely
// shouldn't let any more targets do that. // shouldn't let any more targets do that.
// (Also see <https://github.com/rust-lang/rust/issues/115666>.) // (Also see <https://github.com/rust-lang/rust/issues/115666>.)
//
// The unstable api `PtxKernel` also uses Direct for now.
// It needs to switch to something else before stabilization can happen.
// (Tracking issue abi_ptx: https://github.com/rust-lang/rust/issues/38788)
assert!( assert!(
matches!(&*cx.tcx.sess.target.arch, "wasm32" | "wasm64"), matches!(&*cx.tcx.sess.target.arch, "wasm32" | "wasm64")
|| self.conv == Conv::PtxKernel,
"`PassMode::Direct` for aggregates only allowed on wasm targets\nProblematic type: {:#?}", "`PassMode::Direct` for aggregates only allowed on wasm targets\nProblematic type: {:#?}",
arg.layout, arg.layout,
); );