[PATCH] D31783: Move size and alignment information of regclass to TargetRegisterInfo

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 10:59:15 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.

It feels slightly odd that the size of a register is a property of the register class (amusingly even the comment talks about a register when the function actually takes a class). On the other hand generating a list of register sizes would be extremely wasteful on targets with thousands of registers, so this is the best solution I can of today.

LGTM!



================
Comment at: include/llvm/Target/TargetRegisterInfo.h:323
 
+  /// Return the size of the register in bits.
+  unsigned getRegSizeInBits(const TargetRegisterClass &RC) const {
----------------
This takes a register class not a register.


================
Comment at: include/llvm/Target/TargetRegisterInfo.h:328-329
+
+  /// Return the size in bytes of the stack slot allocated to hold a spilled
+  /// copy of this register.
+  unsigned getSpillSize(const TargetRegisterClass &RC) const {
----------------
This is about a register class not a register.


Repository:
  rL LLVM

https://reviews.llvm.org/D31783





More information about the llvm-commits mailing list