[PATCH] D50285: [MC] Remove MCRegisterClass::getSize

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 10 01:39:30 PDT 2018


bjope added a comment.

In https://reviews.llvm.org/D50285#1194920, @bogner wrote:

> What exactly are out of tree targets supposed to migrate to?


If you have access to TRI, then TargetRegisterInfo::getRegSizeInBits() or TargetRegisterInfo::getSpillSize() are common options.
The old MCRegisterClass::getSize() was about spill size (it was the result of taking the SpillSize attribute in tablegen register class definitions and dividing it by 8).

With TRI you are able to choose between register size (in bits) or spill size (in bytes).
(well, the spill size is actually in octets for OOT targets like ours that has a byte size of 16...)

If you can't use TRI, then one solution is to revert https://reviews.llvm.org/rL339350 in you repo and maintain the old interface yourself. We've been maintaining the removal of these methods in our OOT repo for a long time, because if someone started to use those methods in-tree, in non-target-specific code, it could result in new miscompiles every time we merged from trunk (since the result from these methods are wrong for non-byte-sized registers).


https://reviews.llvm.org/D50285





More information about the llvm-commits mailing list