Skip to content

Commit fc9e0f3

Browse files
[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.
1 parent 40b8a0f commit fc9e0f3

File tree

1 file changed

+91
-116
lines changed

1 file changed

+91
-116
lines changed

0 commit comments

Comments
 (0)