summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/ValueTypes.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-11 21:31:27 +0000
committerDan Gohman <gohman@apple.com>2009-12-11 21:31:27 +0000
commit87862e77bbf90cf1b68c9eea1f3641ad81435e38 (patch)
treedaf3f31f6a1a8732160f7fd891a085a53a783f6f /include/llvm/CodeGen/ValueTypes.h
parentc8f9e4fdc584c6bf48dc0f42083d05b707024b20 (diff)
downloadllvm-87862e77bbf90cf1b68c9eea1f3641ad81435e38.tar.gz
llvm-87862e77bbf90cf1b68c9eea1f3641ad81435e38.tar.bz2
llvm-87862e77bbf90cf1b68c9eea1f3641ad81435e38.tar.xz
Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/ValueTypes.h')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 45ef9b9304..3106213e5d 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -166,6 +166,12 @@ namespace llvm {
return *this;
}
}
+
+ /// getScalarType - If this is a vector type, return the element type,
+ /// otherwise return this.
+ MVT getScalarType() const {
+ return isVector() ? getVectorElementType() : *this;
+ }
MVT getVectorElementType() const {
switch (SimpleTy) {
@@ -524,6 +530,12 @@ namespace llvm {
return V;
}
+ /// getScalarType - If this is a vector type, return the element type,
+ /// otherwise return this.
+ EVT getScalarType() const {
+ return isVector() ? getVectorElementType() : *this;
+ }
+
/// getVectorElementType - Given a vector type, return the type of
/// each element.
EVT getVectorElementType() const {