This is an archive of the discontinued LLVM Phabricator instance.

[MC] Use MCRI instead of MRI for MCRegisterInfo. NFC.
AcceptedPublic

Authored by foad on Jan 23 2023, 6:18 AM.

Details

Summary

This is to avoid confusion with MachineRegisterInfo.

Diff Detail

Event Timeline

foad created this revision.Jan 23 2023, 6:18 AM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
foad requested review of this revision.Jan 23 2023, 6:18 AM
MaskRay accepted this revision.Jan 23 2023, 6:28 AM

LGTM.

This revision is now accepted and ready to land.Jan 23 2023, 6:28 AM

I don't think this is an improvement. People got used to MRI (which is consistent with MII, MAI, etc.) and will continue to use it, which will introduce more inconsistencies.

This is to avoid confusion with MachineRegisterInfo.

IMHO there is no confusion. MachineRegisterInfo is only used in CodeGen, while MCRegisterInfo is primarily used in MC layer.
Just note that almost all affected files are in MCTargetDesc/AsmParser/Disassembler directories.

foad added a comment.Jan 23 2023, 7:18 AM

IMHO there is no confusion. MachineRegisterInfo is only used in CodeGen, while MCRegisterInfo is primarily used in MC layer.
Just note that almost all affected files are in MCTargetDesc/AsmParser/Disassembler directories.

I don't feel too strongly about it, but there are a bunch of files that use both, like lib/Target/*/*FrameLowering.cpp.

IMHO there is no confusion. MachineRegisterInfo is only used in CodeGen, while MCRegisterInfo is primarily used in MC layer.
Just note that almost all affected files are in MCTargetDesc/AsmParser/Disassembler directories.

I don't feel too strongly about it, but there are a bunch of files that use both, like lib/Target/*/*FrameLowering.cpp.

I believe they could be refactored to use TargetRegisterInfo instead. This is at least true for getDwarfRegNum.