[PATCH] D88256: [NFC][regalloc] Separate iteration from AllocationOrder

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 18:23:48 PDT 2020


mtrofin marked an inline comment as done.
mtrofin added inline comments.


================
Comment at: llvm/lib/CodeGen/AllocationOrder.h:38-39
+  class Iterator final {
+    const ArrayRef<MCPhysReg> Hints;
+    const ArrayRef<MCPhysReg> Order;
+    int Pos = 0;
----------------
wmi wrote:
> Can you have a reference of AllocationOrder in Iterator instead of defining multiple fields? It looks a little clearer to access parent's fields directly.  
With the current way, I'm leveraging the ability of constructing a view over the Order ArrayRef. Also, we could author a test very easily now, avoiding the need for a Matrix, RegClassInfo, etc (what AllocationOrder needs) - albeit currently the .h is under lib/CodeGen; but we could as a next step.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88256



More information about the llvm-commits mailing list