[llvm] r262357 - Add isScalarInteger helper to EVT/MVT
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 1 10:01:29 PST 2016
Author: arsenm
Date: Tue Mar 1 12:01:28 2016
New Revision: 262357
URL: http://llvm.org/viewvc/llvm-project?rev=262357&view=rev
Log:
Add isScalarInteger helper to EVT/MVT
Modified:
llvm/trunk/include/llvm/CodeGen/MachineValueType.h
llvm/trunk/include/llvm/CodeGen/ValueTypes.h
llvm/trunk/lib/IR/ValueTypes.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineValueType.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineValueType.h?rev=262357&r1=262356&r2=262357&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineValueType.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineValueType.h Tue Mar 1 12:01:28 2016
@@ -210,6 +210,13 @@ class MVT {
SimpleTy <= MVT::LAST_INTEGER_VECTOR_VALUETYPE));
}
+ /// isScalarInteger - Return true if this is an integer, not including
+ /// vectors.
+ bool isScalarInteger() const {
+ return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
+ SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
+ }
+
/// isVector - Return true if this is a vector value type.
bool isVector() const {
return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=262357&r1=262356&r2=262357&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Tue Mar 1 12:01:28 2016
@@ -124,6 +124,11 @@ namespace llvm {
return isSimple() ? V.isInteger() : isExtendedInteger();
}
+ /// isScalarInteger - Return true if this is an integer, but not a vector.
+ bool isScalarInteger() const {
+ return isSimple() ? V.isScalarInteger() : isExtendedScalarInteger();
+ }
+
/// isVector - Return true if this is a vector value type.
bool isVector() const {
return isSimple() ? V.isVector() : isExtendedVector();
@@ -367,6 +372,7 @@ namespace llvm {
unsigned NumElements);
bool isExtendedFloatingPoint() const LLVM_READONLY;
bool isExtendedInteger() const LLVM_READONLY;
+ bool isExtendedScalarInteger() const LLVM_READONLY;
bool isExtendedVector() const LLVM_READONLY;
bool isExtended16BitVector() const LLVM_READONLY;
bool isExtended32BitVector() const LLVM_READONLY;
Modified: llvm/trunk/lib/IR/ValueTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ValueTypes.cpp?rev=262357&r1=262356&r2=262357&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ValueTypes.cpp (original)
+++ llvm/trunk/lib/IR/ValueTypes.cpp Tue Mar 1 12:01:28 2016
@@ -55,6 +55,11 @@ bool EVT::isExtendedInteger() const {
return LLVMTy->isIntOrIntVectorTy();
}
+bool EVT::isExtendedScalarInteger() const {
+ assert(isExtended() && "Type is not extended!");
+ return LLVMTy->isIntegerTy();
+}
+
bool EVT::isExtendedVector() const {
assert(isExtended() && "Type is not extended!");
return LLVMTy->isVectorTy();
More information about the llvm-commits
mailing list