[PATCH] D152098: [MC] Add MCRegisterInfo::regunits for iteration over register units
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 07:36:58 PDT 2023
foad added inline comments.
================
Comment at: llvm/include/llvm/MC/MCRegister.h:23-29
+/// Register units are used to model interference and register pressure.
+/// Every register is assigned one or more register units such that two
+/// registers overlap if and only if they have a register unit in common.
+///
+/// Normally, one register unit is created per leaf register. Non-leaf
+/// registers inherit the units of their sub-registers.
+using MCRegUnit = unsigned;
----------------
barannikov88 wrote:
> barannikov88 wrote:
> > foad wrote:
> > > Do you need to touch `MCRegister.h`? There is already an introductory comment like this near the definition of `MCRegUnitIterator` in `MCRegisterInfo.h`.
> > I've always been confused by register units and their difference from physical registers.
> > This is the first place I'd search for the definition of a register unit.
> >
> > I'm hoping to turn this typedef into a class for stricter type checking some day.
> >
> @foad I really think MCRegUnit needs to be documented.
> I can move the introductory comment you mentioned here. Would that be ok for you?
>
Sure. The only thing I don't like is having two different introductory comments in two different places.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152098/new/
https://reviews.llvm.org/D152098
More information about the llvm-commits
mailing list