diff options
Diffstat (limited to 'include/llvm/CodeGen/ValueTypes.h')
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index ef70dab3fe..dd9b4ae309 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -266,6 +266,12 @@ namespace llvm { return (getSizeInBits() & 7) == 0; } + /// isRound - Return true if the size is a power-of-two number of bytes. + inline bool isRound() const { + unsigned BitSize = getSizeInBits(); + return BitSize >= 8 && !(BitSize & (BitSize - 1)); + } + /// bitsGT - Return true if this has more bits than VT. inline bool bitsGT(MVT VT) const { return getSizeInBits() > VT.getSizeInBits(); |