@@ -2,7 +2,7 @@ use std::collections::hash_map::Entry;
22use std:: marker:: PhantomData ;
33use std:: ops:: Range ;
44
5- use rustc_abi:: { BackendRepr , FieldIdx , FieldsShape , ScalableElt , Size , VariantIdx } ;
5+ use rustc_abi:: { BackendRepr , FieldIdx , FieldsShape , Size , VariantIdx } ;
66use rustc_data_structures:: fx:: FxHashMap ;
77use rustc_index:: IndexVec ;
88use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
@@ -437,16 +437,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
437437 // anyway.
438438 if operand. layout . ty . is_scalable_vector ( )
439439 && bx. sess ( ) . target . arch == rustc_target:: spec:: Arch :: AArch64
440- && let ty:: Adt ( adt, args) = & operand. layout . ty . kind ( )
441- && let Some ( marker_type_field) =
442- adt. non_enum_variant ( ) . fields . get ( FieldIdx :: from_u32 ( 0 ) )
443440 {
444- let marker_type = marker_type_field. ty ( bx. tcx ( ) , args) ;
441+ let ( count, element_ty) =
442+ operand. layout . ty . scalable_vector_element_count_and_type ( bx. tcx ( ) ) ;
445443 // i.e. `<vscale x N x i1>` when `N != 16`
446- if let ty:: Slice ( element_ty) = marker_type. kind ( )
447- && element_ty. is_bool ( )
448- && adt. repr ( ) . scalable != Some ( ScalableElt :: ElementCount ( 16 ) )
449- {
444+ if element_ty. is_bool ( ) && count != 16 {
450445 return ;
451446 }
452447 }
0 commit comments