Skip to content

Commit d6e7c3a

Browse files
committed
fix condition checks for SVE <vscale x N x i1> when N != 16
1 parent 419c548 commit d6e7c3a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::hash_map::Entry;
22
use std::marker::PhantomData;
33
use std::ops::Range;
44

5-
use rustc_abi::{BackendRepr, FieldIdx, FieldsShape, ScalableElt, Size, VariantIdx};
5+
use rustc_abi::{BackendRepr, FieldIdx, FieldsShape, Size, VariantIdx};
66
use rustc_data_structures::fx::FxHashMap;
77
use rustc_index::IndexVec;
88
use 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

Comments
 (0)