diff options
author | David Greene <greened@obbligato.org> | 2011-01-24 20:53:18 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-01-24 20:53:18 +0000 |
commit | 127fd1d54041cc27c61fddd697377ea21dceef20 (patch) | |
tree | f628cbaa72d777d31488ed8a958c326c93c94186 /llvm/utils/TableGen/CodeGenDAGPatterns.h | |
parent | e74e60cd506fd081c77011785b1d375dccc24409 (diff) | |
download | llvm-127fd1d54041cc27c61fddd697377ea21dceef20.zip llvm-127fd1d54041cc27c61fddd697377ea21dceef20.tar.gz llvm-127fd1d54041cc27c61fddd697377ea21dceef20.tar.bz2 |
[AVX] Add type checking support for vector/subvector type constraints.
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode. INSERT_SUBVECTOR in turn is very useful for
matching to VINSERTF128 instructions and complements the already
existing EXTRACT_SUBVECTOR SDNode.
llvm-svn: 124145
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h index 7a3f705..946dcee 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h @@ -131,6 +131,10 @@ namespace EEVT { /// whose element is VT. bool EnforceVectorEltTypeIs(EEVT::TypeSet &VT, TreePattern &TP); + /// EnforceVectorSubVectorTypeIs - 'this' is now constrainted to + /// be a vector type VT. + bool EnforceVectorSubVectorTypeIs(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; } @@ -155,7 +159,8 @@ struct SDTypeConstraint { unsigned OperandNo; // The operand # this constraint applies to. enum { SDTCisVT, SDTCisPtrTy, SDTCisInt, SDTCisFP, SDTCisVec, SDTCisSameAs, - SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp, SDTCisEltOfVec + SDTCisVTSmallerThanOp, SDTCisOpSmallerThanOp, SDTCisEltOfVec, + SDTCisSubVecOfVec } ConstraintType; union { // The discriminated union. @@ -174,6 +179,9 @@ struct SDTypeConstraint { struct { unsigned OtherOperandNum; } SDTCisEltOfVec_Info; + struct { + unsigned OtherOperandNum; + } SDTCisSubVecOfVec_Info; } x; /// ApplyTypeConstraint - Given a node in a pattern, apply this type |