You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
0 commit comments