[PATCH] D63496: [WIP] CodeGen: Prototype class for registers

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 11:58:35 PDT 2019


qcolombet added a comment.

Thanks for doing this Matt, this is a long due clean-up.
I haven't looked carefully at all the changes, but the general direction LGTM.

One question: right now, we already have `MCPhysReg` for physical registers (unfortunately it is not used consistently, but that's a different story), should we replace those as well with `Register` or be explicitly about what is expected in the related passes?

I am torn because MCPhysReg gives more information on what is expected, but on the other hand it will be pretty easy to slip `Register` here and there over time and we would end up with an inconsistent code base again.
What do you think?



================
Comment at: include/llvm/CodeGen/Register.h:27
+    //assert(!isStackSlot(Reg) && "Not a register! Check isStackSlot() first.");
+    return int(Reg) > 0;
+  }
----------------
I am not sure I like those, since it still allows using Reg as plain unsigned.


================
Comment at: include/llvm/CodeGen/Register.h:56
+    return Reg;
+  }
+
----------------
Ditto.


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

https://reviews.llvm.org/D63496





More information about the llvm-commits mailing list