mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Use PassMode::ByVal for Abi::Vector
This commit is contained in:
parent
08fc673190
commit
67028cee51
@ -100,7 +100,13 @@ pub(super) fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>)
|
||||
}
|
||||
|
||||
// FIXME implement Vector Abi in a cg_llvm compatible way
|
||||
Abi::Vector { .. } => PassMode::ByRef { size: Some(layout.size) },
|
||||
Abi::Vector { .. } => {
|
||||
if let Some(vector_ty) = crate::intrinsics::clif_vector_type(tcx, layout) {
|
||||
PassMode::ByVal(vector_ty)
|
||||
} else {
|
||||
PassMode::ByRef { size: Some(layout.size) }
|
||||
}
|
||||
}
|
||||
|
||||
Abi::Aggregate { sized: true } => PassMode::ByRef { size: Some(layout.size) },
|
||||
Abi::Aggregate { sized: false } => PassMode::ByRef { size: None },
|
||||
|
@ -175,7 +175,7 @@ fn lane_type_and_count<'tcx>(
|
||||
(lane_layout, lane_count)
|
||||
}
|
||||
|
||||
fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
|
||||
pub(crate) fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
|
||||
let (element, count) = match &layout.abi {
|
||||
Abi::Vector { element, count } => (element.clone(), *count),
|
||||
_ => unreachable!(),
|
||||
|
Loading…
Reference in New Issue
Block a user