File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ class RISCVVectorMaskDAGMutation : public ScheduleDAGMutation {
4747public:
4848 RISCVVectorMaskDAGMutation (const TargetRegisterInfo *TRI) : TRI(TRI) {}
4949
50+ bool isCopyToV0 (const MachineInstr &MI) {
51+ return MI.isCopy () && MI.getOperand (0 ).getReg () == RISCV::V0 &&
52+ MI.getOperand (1 ).getReg ().isVirtual () &&
53+ MI.getOperand (1 ).getSubReg () == RISCV::NoSubRegister;
54+ }
55+
5056 bool isSoleUseCopyToV0 (SUnit &SU) {
5157 if (SU.Succs .size () != 1 )
5258 return false ;
@@ -58,11 +64,7 @@ class RISCVVectorMaskDAGMutation : public ScheduleDAGMutation {
5864 SUnit &DepSU = *Dep.getSUnit ();
5965 if (DepSU.isBoundaryNode ())
6066 return false ;
61-
62- const MachineInstr *DepMI = DepSU.getInstr ();
63- return DepMI->isCopy () && DepMI->getOperand (0 ).getReg () == RISCV::V0 &&
64- DepMI->getOperand (1 ).getReg ().isVirtual () &&
65- DepMI->getOperand (1 ).getSubReg () == RISCV::NoSubRegister;
67+ return isCopyToV0 (*DepSU.getInstr ());
6668 }
6769
6870 void apply (ScheduleDAGInstrs *DAG) override {
You can’t perform that action at this time.
0 commit comments