Add helpers for getting scalar sizes of vector value types.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Mar 2014 01:38:48 +0000 (01:38 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Mar 2014 01:38:48 +0000 (01:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203526 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
include/llvm/CodeGen/ValueTypes.h

index 072b6af4d705e2ab41d903111921bbea2d2f4a79..74c291eba17568c575ca8876491aa85057526552 100644 (file)
@@ -145,6 +145,10 @@ public:
     return getValueType().getSizeInBits();
   }
 
+  unsigned getScalarValueSizeInBits() const {
+    return getValueType().getScalarType().getSizeInBits();
+  }
+
   // Forwarding methods - These forward to the corresponding methods in SDNode.
   inline unsigned getOpcode() const;
   inline unsigned getNumOperands() const;
index d59670410bf816685ab6337ac1604b9c3add4673..982e23c611a2f943febcf30ce3477c92a2b9f410 100644 (file)
@@ -434,6 +434,10 @@ namespace llvm {
       }
     }
 
+    unsigned getScalarSizeInBits() const {
+      return getScalarType().getSizeInBits();
+    }
+
     /// getStoreSize - Return the number of bytes overwritten by a store
     /// of the specified value type.
     unsigned getStoreSize() const {
@@ -788,6 +792,10 @@ namespace llvm {
       return getExtendedSizeInBits();
     }
 
+    unsigned getScalarSizeInBits() const {
+      return getScalarType().getSizeInBits();
+    }
+
     /// getStoreSize - Return the number of bytes overwritten by a store
     /// of the specified value type.
     unsigned getStoreSize() const {