diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-03-11 01:38:48 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-03-11 01:38:48 +0000 |
commit | 3d9940213174bbc49696dd81adeac2cf1e77d763 (patch) | |
tree | 87061481b1c8d4f80490ba2199aae41f0ae3a2a5 | |
parent | 023d2ca45198d6a0440e8c9ba173dc57b186d4bc (diff) | |
download | bcm5719-llvm-3d9940213174bbc49696dd81adeac2cf1e77d763.tar.gz bcm5719-llvm-3d9940213174bbc49696dd81adeac2cf1e77d763.zip |
Add helpers for getting scalar sizes of vector value types.
llvm-svn: 203526
-rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/CodeGen/ValueTypes.h | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h index 072b6af4d70..74c291eba17 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -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; diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h index d59670410bf..982e23c611a 100644 --- a/llvm/include/llvm/CodeGen/ValueTypes.h +++ b/llvm/include/llvm/CodeGen/ValueTypes.h @@ -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 { |