@@ -651,29 +651,21 @@ void RISCVInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
651
651
MachineFrameInfo &MFI = MF->getFrameInfo ();
652
652
653
653
unsigned Opcode;
654
- bool IsScalableVector = true ;
655
654
if (RISCV::GPRRegClass.hasSubClassEq (RC)) {
656
655
Opcode = TRI->getRegSizeInBits (RISCV::GPRRegClass) == 32 ?
657
656
RISCV::SW : RISCV::SD;
658
- IsScalableVector = false ;
659
657
} else if (RISCV::GPRF16RegClass.hasSubClassEq (RC)) {
660
658
Opcode = RISCV::SH_INX;
661
- IsScalableVector = false ;
662
659
} else if (RISCV::GPRF32RegClass.hasSubClassEq (RC)) {
663
660
Opcode = RISCV::SW_INX;
664
- IsScalableVector = false ;
665
661
} else if (RISCV::GPRPairRegClass.hasSubClassEq (RC)) {
666
662
Opcode = RISCV::PseudoRV32ZdinxSD;
667
- IsScalableVector = false ;
668
663
} else if (RISCV::FPR16RegClass.hasSubClassEq (RC)) {
669
664
Opcode = RISCV::FSH;
670
- IsScalableVector = false ;
671
665
} else if (RISCV::FPR32RegClass.hasSubClassEq (RC)) {
672
666
Opcode = RISCV::FSW;
673
- IsScalableVector = false ;
674
667
} else if (RISCV::FPR64RegClass.hasSubClassEq (RC)) {
675
668
Opcode = RISCV::FSD;
676
- IsScalableVector = false ;
677
669
} else if (RISCV::VRRegClass.hasSubClassEq (RC)) {
678
670
Opcode = RISCV::VS1R_V;
679
671
} else if (RISCV::VRM2RegClass.hasSubClassEq (RC)) {
@@ -707,7 +699,7 @@ void RISCVInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
707
699
else
708
700
llvm_unreachable (" Can't store this register to stack slot" );
709
701
710
- if (IsScalableVector ) {
702
+ if (RISCVRegisterInfo::isRVVRegClass (RC) ) {
711
703
MachineMemOperand *MMO = MF->getMachineMemOperand (
712
704
MachinePointerInfo::getFixedStack (*MF, FI), MachineMemOperand::MOStore,
713
705
TypeSize::getScalable (MFI.getObjectSize (FI)), MFI.getObjectAlign (FI));
@@ -743,29 +735,21 @@ void RISCVInstrInfo::loadRegFromStackSlot(
743
735
Flags & MachineInstr::FrameDestroy ? MBB.findDebugLoc (I) : DebugLoc ();
744
736
745
737
unsigned Opcode;
746
- bool IsScalableVector = true ;
747
738
if (RISCV::GPRRegClass.hasSubClassEq (RC)) {
748
739
Opcode = TRI->getRegSizeInBits (RISCV::GPRRegClass) == 32 ?
749
740
RISCV::LW : RISCV::LD;
750
- IsScalableVector = false ;
751
741
} else if (RISCV::GPRF16RegClass.hasSubClassEq (RC)) {
752
742
Opcode = RISCV::LH_INX;
753
- IsScalableVector = false ;
754
743
} else if (RISCV::GPRF32RegClass.hasSubClassEq (RC)) {
755
744
Opcode = RISCV::LW_INX;
756
- IsScalableVector = false ;
757
745
} else if (RISCV::GPRPairRegClass.hasSubClassEq (RC)) {
758
746
Opcode = RISCV::PseudoRV32ZdinxLD;
759
- IsScalableVector = false ;
760
747
} else if (RISCV::FPR16RegClass.hasSubClassEq (RC)) {
761
748
Opcode = RISCV::FLH;
762
- IsScalableVector = false ;
763
749
} else if (RISCV::FPR32RegClass.hasSubClassEq (RC)) {
764
750
Opcode = RISCV::FLW;
765
- IsScalableVector = false ;
766
751
} else if (RISCV::FPR64RegClass.hasSubClassEq (RC)) {
767
752
Opcode = RISCV::FLD;
768
- IsScalableVector = false ;
769
753
} else if (RISCV::VRRegClass.hasSubClassEq (RC)) {
770
754
Opcode = RISCV::VL1RE8_V;
771
755
} else if (RISCV::VRM2RegClass.hasSubClassEq (RC)) {
@@ -799,7 +783,7 @@ void RISCVInstrInfo::loadRegFromStackSlot(
799
783
else
800
784
llvm_unreachable (" Can't load this register from stack slot" );
801
785
802
- if (IsScalableVector ) {
786
+ if (RISCVRegisterInfo::isRVVRegClass (RC) ) {
803
787
MachineMemOperand *MMO = MF->getMachineMemOperand (
804
788
MachinePointerInfo::getFixedStack (*MF, FI), MachineMemOperand::MOLoad,
805
789
TypeSize::getScalable (MFI.getObjectSize (FI)), MFI.getObjectAlign (FI));
0 commit comments