[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 13:26:40 PDT 2023
barannikov88 added inline comments.
================
Comment at: llvm/include/llvm/MC/MCRegisterInfo.h:315
+ unsigned Offset = RU >> RegUnitBits;
+ init(FirstRU, MCRI->DiffLists + Offset);
+ }
----------------
qcolombet wrote:
> Could you refactor the code to share the implementation with `MCRegUnitIterator::MCRegUnitIterator`?
> E.g., a static helper function.
There is indeed code duplication between mc_*_iterator and MC*Iterator classes. AIUI MC version was supposed to replace mc_ version eventually.
They don't have common base class to extract this to. I tried to address code duplication in D152655, please take a look.
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