@@ -412,7 +412,7 @@ static void buildCopyFromRegs(MachineIRBuilder &B, ArrayRef<Register> OrigRegs,
412
412
// size, e.g. PartLLT == v2s64 and LLTy is v3s32, then first coerce it to
413
413
// have the same elt type, i.e. v4s32.
414
414
// TODO: Extend this coersion to element multiples other than just 2.
415
- if (PartLLT.getSizeInBits () > LLTy.getSizeInBits () &&
415
+ if (TypeSize::isKnownGT ( PartLLT.getSizeInBits (), LLTy.getSizeInBits () ) &&
416
416
PartLLT.getScalarSizeInBits () == LLTy.getScalarSizeInBits () * 2 &&
417
417
Regs.size () == 1 ) {
418
418
LLT NewTy = PartLLT.changeElementType (LLTy.getElementType ())
@@ -529,7 +529,7 @@ static void buildCopyToRegs(MachineIRBuilder &B, ArrayRef<Register> DstRegs,
529
529
// We could just insert a regular copy, but this is unreachable at the moment.
530
530
assert (SrcTy != PartTy && " identical part types shouldn't reach here" );
531
531
532
- const unsigned PartSize = PartTy.getSizeInBits ();
532
+ const TypeSize PartSize = PartTy.getSizeInBits ();
533
533
534
534
if (PartTy.isVector () == SrcTy.isVector () &&
535
535
PartTy.getScalarSizeInBits () > SrcTy.getScalarSizeInBits ()) {
@@ -539,7 +539,7 @@ static void buildCopyToRegs(MachineIRBuilder &B, ArrayRef<Register> DstRegs,
539
539
}
540
540
541
541
if (SrcTy.isVector () && !PartTy.isVector () &&
542
- PartSize > SrcTy.getElementType ().getSizeInBits ()) {
542
+ TypeSize::isKnownGT ( PartSize, SrcTy.getElementType ().getSizeInBits () )) {
543
543
// Vector was scalarized, and the elements extended.
544
544
auto UnmergeToEltTy = B.buildUnmerge (SrcTy.getElementType (), SrcReg);
545
545
for (int i = 0 , e = DstRegs.size (); i != e; ++i)
@@ -548,9 +548,10 @@ static void buildCopyToRegs(MachineIRBuilder &B, ArrayRef<Register> DstRegs,
548
548
}
549
549
550
550
if (SrcTy.isVector () && PartTy.isVector () &&
551
- PartTy.getScalarSizeInBits () == SrcTy.getScalarSizeInBits () &&
552
- SrcTy.getNumElements () < PartTy.getNumElements ()) {
553
- // A coercion like: v2f32 -> v4f32.
551
+ PartTy.getSizeInBits () == SrcTy.getSizeInBits () &&
552
+ ElementCount::isKnownLT (SrcTy.getElementCount (),
553
+ PartTy.getElementCount ())) {
554
+ // A coercion like: v2f32 -> v4f32 or nxv2f32 -> nxv4f32
554
555
Register DstReg = DstRegs.front ();
555
556
B.buildPadVectorWithUndefElements (DstReg, SrcReg);
556
557
return ;
0 commit comments