[PATCH] D146734: [CodeGen] Use RegUnits in RegisterClassInfo::getLastCalleeSavedAlias

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 06:22:38 PDT 2023


foad added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/RegisterClassInfo.h:121
+    for (MCRegUnitIterator UI(PhysReg, TRI); UI.isValid(); ++UI) {
+      CSR = CalleeSavedAliases[*UI];
+      if (CSR)
----------------
qcolombet wrote:
> Cannot this get out of range?
> I.e., I believe we could assert that `*UI` is bigger than `CalleeSavedAliases.size()`.
> 
> I am wondering why the check was there in the previous implementation.
I don't know! I just found that when I removed the check, everything still worked.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146734/new/

https://reviews.llvm.org/D146734



More information about the llvm-commits mailing list