Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV][GISEL][NFC] Make MRI a member in RISCVInstructionSelector
It was requested in llvm#110782 (comment) that MRI be made a member of RISCVInstructionSelector. RISCVInstructionSelector is created in the RISCVSubtarget, independent of MachineFunction. So it cannot be passed by reference during construction of RISCVInstructionSelector. The MachineRegisterInfo object belongs to each MachineFunction, so we will set it as we enter `select`, which is the only public function to RISCVInstructionSelector. We don't need to worry about clearing it before returning from `select`, since there is no other entry point. I'm not sure this is any better than what we have today. Not sure whether we should take this change or not. If in the future we have other public functions of RISCVInstructionSelector, we will need to be more careful about checking that MRI is set and clearing it where appropriate.
- Loading branch information