[PATCH] D152098: [MC] Add MCRegisterInfo::regunits for iteration over register units
Sergei Barannikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 14:29:40 PDT 2023
barannikov88 marked 3 inline comments as done.
barannikov88 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;
----------------
foad wrote:
> 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.
I've moved the comment from MCRegisterInfo.h here as is.
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