summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-08-11 01:14:02 +0000
committerBob Wilson <bob.wilson@apple.com>2009-08-11 01:14:02 +0000
commit2cd5da8300fe47f801ffc97638f723646b892d8a (patch)
tree56b3e79aebd28b816172ce5de1ee7aaa36cfdf6a /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent5cfb60ffc7c1b1012091a704cd93711ea69cb808 (diff)
downloadbcm5719-llvm-2cd5da8300fe47f801ffc97638f723646b892d8a.tar.gz
bcm5719-llvm-2cd5da8300fe47f801ffc97638f723646b892d8a.zip
Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type. llvm-svn: 78631
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 05ede6cec6d..af72b93fd30 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -87,9 +87,16 @@ bool isExtIntegerInVTs(const std::vector<unsigned char> &EVTs) {
/// isExtFloatingPointInVTs - Return true if the specified extended value type
/// vector contains isFP or a FP value type.
bool isExtFloatingPointInVTs(const std::vector<unsigned char> &EVTs) {
- assert(!EVTs.empty() && "Cannot check for integer in empty ExtVT list!");
+ assert(!EVTs.empty() && "Cannot check for FP in empty ExtVT list!");
return EVTs[0] == isFP || !(FilterEVTs(EVTs, isFloatingPoint).empty());
}
+
+/// isExtVectorInVTs - Return true if the specified extended value type
+/// vector contains a vector value type.
+bool isExtVectorInVTs(const std::vector<unsigned char> &EVTs) {
+ assert(!EVTs.empty() && "Cannot check for vector in empty ExtVT list!");
+ return !(FilterEVTs(EVTs, isVector).empty());
+}
} // end namespace EEVT.
} // end namespace llvm.
@@ -495,6 +502,14 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs,
setTypes(FVTs);
return true;
}
+ if (ExtVTs[0] == EVT::vAny && EEVT::isExtVectorInVTs(getExtTypes())) {
+ assert(hasTypeSet() && "should be handled above!");
+ std::vector<unsigned char> FVTs = FilterEVTs(getExtTypes(), isVector);
+ if (getExtTypes() == FVTs)
+ return false;
+ setTypes(FVTs);
+ return true;
+ }
// If we know this is an int or fp type, and we are told it is a specific one,
// take the advice.
@@ -504,7 +519,9 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs,
if (((getExtTypeNum(0) == EEVT::isInt || getExtTypeNum(0) == EVT::iAny) &&
EEVT::isExtIntegerInVTs(ExtVTs)) ||
((getExtTypeNum(0) == EEVT::isFP || getExtTypeNum(0) == EVT::fAny) &&
- EEVT::isExtFloatingPointInVTs(ExtVTs))) {
+ EEVT::isExtFloatingPointInVTs(ExtVTs)) ||
+ (getExtTypeNum(0) == EVT::vAny &&
+ EEVT::isExtVectorInVTs(ExtVTs))) {
setTypes(ExtVTs);
return true;
}
OpenPOWER on IntegriCloud