File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -361,15 +361,12 @@ void RISCVInstrInfo::copyPhysRegVector(
361361 return {RISCVII::LMUL_1, RISCV::VRRegClass, RISCV::VMV1R_V,
362362 RISCV::PseudoVMV_V_V_M1, RISCV::PseudoVMV_V_I_M1};
363363 };
364- auto FindRegWithEncoding = [&TRI](const TargetRegisterClass &RegClass,
365- uint16_t Encoding) {
366- ArrayRef<MCPhysReg> Regs = RegClass.getRegisters ();
367- const auto *FoundReg = llvm::find_if (Regs, [&](MCPhysReg Reg) {
368- return TRI->getEncodingValue (Reg) == Encoding;
369- });
370- // We should be always able to find one valid register.
371- assert (FoundReg != Regs.end ());
372- return *FoundReg;
364+ auto FindRegWithEncoding = [TRI](const TargetRegisterClass &RegClass,
365+ uint16_t Encoding) {
366+ MCRegister Reg = RISCV::V0 + Encoding;
367+ if (&RegClass == &RISCV::VRRegClass)
368+ return Reg;
369+ return TRI->getMatchingSuperReg (Reg, RISCV::sub_vrm1_0, &RegClass);
373370 };
374371 while (I != NumRegs) {
375372 // For non-segment copying, we only do this once as the registers are always
You can’t perform that action at this time.
0 commit comments