[PATCH] D152098: [MC] Add MCRegisterInfo::regunits for iteration over register units

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 11 18:50:06 PDT 2023


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;
----------------
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?



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