[PATCH] D114759: [NFC][regalloc] Factor accesses to ExtraRegInfo

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 10:29:33 PST 2021


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

LGTM, nits below



================
Comment at: llvm/lib/CodeGen/RegAllocGreedy.cpp:224
 
+  void addNew(Register Reg) {
+    ExtraRegInfo.grow(Reg);
----------------
Could you add a comment on what this method does?


================
Comment at: llvm/lib/CodeGen/RegAllocGreedy.cpp:236
+
+  void onNewRegCount(size_t Count) { ExtraRegInfo.resize(Count); }
+
----------------
Ditto: comment on what it does?

Put differently, the method names are not super informative.


================
Comment at: llvm/lib/CodeGen/RegAllocGreedy.cpp:241
+    if (!Cascade)
+      Cascade = ExtraRegInfo[Reg].Cascade = NextCascade++;
+    return Cascade;
----------------
getCascade followed by setCascade instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114759



More information about the llvm-commits mailing list