aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-03-05 07:11:34 +0000
committerCraig Topper <craig.topper@gmail.com>2015-03-05 07:11:34 +0000
commit0be34580061d8e406507a3832e39f90405ebc209 (patch)
tree1a621604691c54dd8b23e21354cf1c5691239292 /llvm/utils/TableGen/CodeGenDAGPatterns.h
parent1fa434992ba447ca9ce0e77ceaca7cb889c75ccf (diff)
downloadllvm-0be34580061d8e406507a3832e39f90405ebc209.zip
llvm-0be34580061d8e406507a3832e39f90405ebc209.tar.gz
llvm-0be34580061d8e406507a3832e39f90405ebc209.tar.bz2
[TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments.
llvm-svn: 231356
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h
index c0812cf..9ce3cdf 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -136,10 +136,18 @@ namespace EEVT {
/// whose element is VT.
bool EnforceVectorEltTypeIs(EEVT::TypeSet &VT, TreePattern &TP);
+ /// EnforceVectorEltTypeIs - 'this' is now constrainted to be a vector type
+ /// whose element is VT.
+ bool EnforceVectorEltTypeIs(MVT::SimpleValueType VT, TreePattern &TP);
+
/// EnforceVectorSubVectorTypeIs - 'this' is now constrainted to
/// be a vector type VT.
bool EnforceVectorSubVectorTypeIs(EEVT::TypeSet &VT, TreePattern &TP);
+ /// EnforceVectorSameNumElts - 'this' is now constrainted to
+ /// be a vector with same num elements as VT.
+ bool EnforceVectorSameNumElts(EEVT::TypeSet &VT, TreePattern &TP);
+
bool operator!=(const TypeSet &RHS) const { return TypeVec != RHS.TypeVec; }
bool operator==(const TypeSet &RHS) const { return TypeVec == RHS.TypeVec; }
@@ -165,7 +173,7 @@ struct SDTypeConstraint {
enum {
SDTCisVT, SDTCisPtrTy, SDTCisInt, SDTCisFP, SDTCisVec, SDTCisSameAs,
SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp, SDTCisEltOfVec,
- SDTCisSubVecOfVec
+ SDTCisSubVecOfVec, SDTCVecEltisVT, SDTCisSameNumEltsAs
} ConstraintType;
union { // The discriminated union.
@@ -187,6 +195,12 @@ struct SDTypeConstraint {
struct {
unsigned OtherOperandNum;
} SDTCisSubVecOfVec_Info;
+ struct {
+ MVT::SimpleValueType VT;
+ } SDTCVecEltisVT_Info;
+ struct {
+ unsigned OtherOperandNum;
+ } SDTCisSameNumEltsAs_Info;
} x;
/// ApplyTypeConstraint - Given a node in a pattern, apply this type