summaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-19 22:40:56 +0000
committerChris Lattner <sabre@nondot.org>2010-03-19 22:40:56 +0000
commit26e763753be5f3422a892f6c268721eae7792eac (patch)
tree9e724155ced23e2c15987f781c3ed75400f7072d /utils/TableGen/CodeGenDAGPatterns.cpp
parent2e68a02c264c26abc6ed62d59f18813fa7fdb95d (diff)
downloadllvm-26e763753be5f3422a892f6c268721eae7792eac.tar.gz
llvm-26e763753be5f3422a892f6c268721eae7792eac.tar.bz2
llvm-26e763753be5f3422a892f6c268721eae7792eac.tar.xz
Change intrinsic result type for void to store it as an empty list
instead of as a single element list with VoidTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp
index 00b6fe2200..710b2ab061 100644
--- a/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -754,12 +754,8 @@ static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) {
Operator->getName() == "parallel")
return 0; // All return nothing.
- if (Operator->isSubClassOf("Intrinsic")) {
- unsigned NumRes = CDP.getIntrinsic(Operator).IS.RetVTs.size();
- if (NumRes == 1 && CDP.getIntrinsic(Operator).IS.RetVTs[0] == MVT::isVoid)
- return 0;
- return NumRes;
- }
+ if (Operator->isSubClassOf("Intrinsic"))
+ return CDP.getIntrinsic(Operator).IS.RetVTs.size();
if (Operator->isSubClassOf("SDNode"))
return CDP.getSDNodeInfo(Operator).getNumResults();
@@ -1210,8 +1206,6 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
// Apply the result type to the node.
unsigned NumRetVTs = Int->IS.RetVTs.size();
unsigned NumParamVTs = Int->IS.ParamVTs.size();
- if (NumRetVTs == 1 && Int->IS.RetVTs[0] == MVT::isVoid)
- NumRetVTs = 0;
for (unsigned i = 0, e = NumRetVTs; i != e; ++i)
MadeChange |= UpdateNodeType(i, Int->IS.RetVTs[i], TP);
@@ -1591,7 +1585,7 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) {
// If this intrinsic returns void, it must have side-effects and thus a
// chain.
- if (Int.IS.RetVTs[0] == MVT::isVoid) {
+ if (Int.IS.RetVTs.empty()) {
Operator = getDAGPatterns().get_intrinsic_void_sdnode();
} else if (Int.ModRef != CodeGenIntrinsic::NoMem) {
// Has side-effects, requires chain.