aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-06-16 08:14:38 +0000
committerDuncan Sands <baldrick@free.fr>2008-06-16 08:14:38 +0000
commitad205a76871b5112a4bf70edca0df9d03b92de49 (patch)
tree8062be5018d4dc0b7c8cce2cf922b5226a41fdd4 /include/llvm/CodeGen
parent7a15391c8dad7d4ff265b6b8f5aa6bcc50107c7a (diff)
Allow these transforms for types like i256 while
still excluding types like i1 (not byte sized) and i120 (loading an i120 requires loading an i64, an i32, an i16 and an i8, which is expensive). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h6
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();