aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-06-02 03:12:52 +0000
committerDale Johannesen <dalej@apple.com>2009-06-02 03:12:52 +0000
commit874ae251c317788391f9c3f113957802d390a063 (patch)
tree4d5ee801f6b36ff51fbd06090212d02c4405b1c6 /utils/TableGen
parent5d16396a33bfaa76da99c97c526a737af9618d05 (diff)
downloadexternal_llvm-874ae251c317788391f9c3f113957802d390a063.zip
external_llvm-874ae251c317788391f9c3f113957802d390a063.tar.gz
external_llvm-874ae251c317788391f9c3f113957802d390a063.tar.bz2
Revert 72707 and 72709, for the moment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.cpp14
-rw-r--r--utils/TableGen/CodeGenTarget.cpp7
-rw-r--r--utils/TableGen/CodeGenTarget.h8
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp64
4 files changed, 18 insertions, 75 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp
index a03224c..db76dab 100644
--- a/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -399,13 +399,9 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) {
} else if (PropList[i]->getName() == "SDNPHasChain") {
Properties |= 1 << SDNPHasChain;
} else if (PropList[i]->getName() == "SDNPOutFlag") {
- Properties |= 1 << SDNPOutFlag;
- assert(!(Properties & (1<<SDNPOutI1)) &&
- "Can't handle OutFlag and OutI1");
+ Properties |= 1 << SDNPOutFlag;
} else if (PropList[i]->getName() == "SDNPInFlag") {
Properties |= 1 << SDNPInFlag;
- assert(!(Properties & (1<<SDNPInI1)) &&
- "Can't handle InFlag and InI1");
} else if (PropList[i]->getName() == "SDNPOptInFlag") {
Properties |= 1 << SDNPOptInFlag;
} else if (PropList[i]->getName() == "SDNPMayStore") {
@@ -416,14 +412,6 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) {
Properties |= 1 << SDNPSideEffect;
} else if (PropList[i]->getName() == "SDNPMemOperand") {
Properties |= 1 << SDNPMemOperand;
- } else if (PropList[i]->getName() == "SDNPInI1") {
- Properties |= 1 << SDNPInI1;
- assert(!(Properties & (1<<SDNPInFlag)) &&
- "Can't handle InFlag and InI1");
- } else if (PropList[i]->getName() == "SDNPOutI1") {
- Properties |= 1 << SDNPOutI1;
- assert(!(Properties & (1<<SDNPOutFlag)) &&
- "Can't handle OutFlag and OutI1");
} else {
cerr << "Unknown SD Node property '" << PropList[i]->getName()
<< "' on node '" << R->getName() << "'!\n";
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index a64aef9..aad1be9 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -385,13 +385,6 @@ bool CodeGenTarget::isLittleEndianEncoding() const {
return getInstructionSet()->getValueAsBit("isLittleEndianEncoding");
}
-/// supportsHasI1 - Return whether this target supports the implicit I1,
-/// rather than Flags, for ADDC/ADDE
-///
-bool CodeGenTarget::supportsHasI1() const {
- return getInstructionSet()->getValueAsBit("supportsHasI1");
-}
-
//===----------------------------------------------------------------------===//
// ComplexPattern implementation
//
diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h
index c44c6f0..c7cc77c 100644
--- a/utils/TableGen/CodeGenTarget.h
+++ b/utils/TableGen/CodeGenTarget.h
@@ -43,9 +43,7 @@ enum SDNP {
SDNPMayLoad,
SDNPMayStore,
SDNPSideEffect,
- SDNPMemOperand,
- SDNPInI1,
- SDNPOutI1
+ SDNPMemOperand
};
// ComplexPattern attributes.
@@ -211,12 +209,10 @@ public:
void getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
&NumberedInstructions);
+
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
///
bool isLittleEndianEncoding() const;
-
- /// supportsHasI1 - does this target understand HasI1 for ADDE and ADDC?
- bool supportsHasI1() const;
};
/// ComplexPattern - ComplexPattern info, corresponding to the ComplexPattern
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 4f92011..0e2e615 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -670,8 +670,7 @@ public:
HasChain = true;
FoldedChains.push_back(std::make_pair(RootName, CInfo.getNumResults()));
}
- if (NodeHasProperty(Child, SDNPOutFlag, CGP) ||
- NodeHasProperty(Child, SDNPOutI1, CGP)) {
+ if (NodeHasProperty(Child, SDNPOutFlag, CGP)) {
assert(FoldedFlag.first == "" && FoldedFlag.second == 0 &&
"Pattern folded multiple nodes which produce flags?");
FoldedFlag = std::make_pair(RootName,
@@ -970,10 +969,6 @@ public:
PatternHasProperty(Pattern, SDNPInFlag, CGP);
bool NodeHasOutFlag = isRoot &&
PatternHasProperty(Pattern, SDNPOutFlag, CGP);
- bool NodeHasInI1 = isRoot &&
- PatternHasProperty(Pattern, SDNPInI1, CGP);
- bool NodeHasOutI1 = isRoot &&
- PatternHasProperty(Pattern, SDNPOutI1, CGP);
bool NodeHasChain = InstPatNode &&
PatternHasProperty(InstPatNode, SDNPHasChain, CGP);
bool InputHasChain = isRoot &&
@@ -1059,13 +1054,10 @@ public:
// Emit all the chain and CopyToReg stuff.
bool ChainEmitted = NodeHasChain;
- // InFlag and InI1 cannot both be set (checked in
- // CodeGenDAGPatterns), so use the same variables for both.
- if (NodeHasInFlag || HasImpInputs || NodeHasInI1)
+ if (NodeHasInFlag || HasImpInputs)
EmitInFlagSelectCode(Pattern, "N", ChainEmitted,
InFlagDecled, ResNodeDecled, true);
- if (NodeHasOptInFlag || NodeHasInFlag || HasImpInputs ||
- NodeHasInI1) {
+ if (NodeHasOptInFlag || NodeHasInFlag || HasImpInputs) {
if (!InFlagDecled) {
emitCode("SDValue InFlag(0, 0);");
InFlagDecled = true;
@@ -1121,7 +1113,7 @@ public:
}
if (NodeHasChain)
Code += ", MVT::Other";
- if (NodeHasOutFlag || (NodeHasOutI1 && !CGT.supportsHasI1()))
+ if (NodeHasOutFlag)
Code += ", MVT::Flag";
// Inputs.
@@ -1181,8 +1173,7 @@ public:
}
Code += ", &Ops" + utostr(OpsNo) + "[0], Ops" + utostr(OpsNo) +
".size()";
- } else if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs ||
- NodeHasInI1)
+ } else if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs)
AllOps.push_back("InFlag");
unsigned NumOps = AllOps.size();
@@ -1216,7 +1207,7 @@ public:
NodeOps.push_back("Tmp" + utostr(ResNo));
} else {
- if (NodeHasOutFlag || NodeHasOutI1) {
+ if (NodeHasOutFlag) {
if (!InFlagDecled) {
After.push_back("SDValue InFlag(ResNode, " +
utostr(NumResults+NumDstRegs+(unsigned)NodeHasChain) +
@@ -1237,15 +1228,13 @@ public:
utostr(NumResults+NumDstRegs) + ")");
}
- if (NodeHasOutFlag || NodeHasOutI1) {
+ if (NodeHasOutFlag) {
if (FoldedFlag.first != "") {
- ReplaceFroms.push_back("SDValue(" + FoldedFlag.first +
- ".getNode(), " +
+ ReplaceFroms.push_back("SDValue(" + FoldedFlag.first + ".getNode(), " +
utostr(FoldedFlag.second) + ")");
ReplaceTos.push_back("InFlag");
} else {
- assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP) ||
- NodeHasProperty(Pattern, SDNPOutI1, CGP));
+ assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP));
ReplaceFroms.push_back("SDValue(N.getNode(), " +
utostr(NumPatResults + (unsigned)InputHasChain)
+ ")");
@@ -1262,8 +1251,7 @@ public:
}
// User does not expect the instruction would produce a chain!
- if ((!InputHasChain && NodeHasChain) &&
- (NodeHasOutFlag || NodeHasOutI1)) {
+ if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) {
;
} else if (InputHasChain && !NodeHasChain) {
// One of the inner node produces a chain.
@@ -1403,8 +1391,6 @@ private:
unsigned OpNo =
(unsigned) NodeHasProperty(N, SDNPHasChain, CGP);
bool HasInFlag = NodeHasProperty(N, SDNPInFlag, CGP);
- bool HasInI1 = NodeHasProperty(N, SDNPInI1, CGP);
- bool InFlagDefined = false;
for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) {
TreePatternNode *Child = N->getChild(i);
if (!Child->isLeaf()) {
@@ -1438,41 +1424,21 @@ private:
emitCode("SDValue InFlag(0, 0);");
InFlagDecled = true;
}
- if (HasInI1) {
- if (!ResNodeDecled) {
- emitCode("SDNode * ResNode;");
- }
- if (T.supportsHasI1())
- emitCode("ResNode = CurDAG->getCopyToReg(" + ChainName +
- ", " + RootName + ".getDebugLoc()" +
- ", " + getEnumName(RVT) +
- ", " + getQualifiedName(RR) +
- ", " + RootName + utostr(OpNo) + ").getNode();");
- else
- emitCode("ResNode = CurDAG->getCopyToReg(" + ChainName +
- ", " + RootName + ".getDebugLoc()" +
- ", " + getQualifiedName(RR) +
- ", " + RootName + utostr(OpNo) +
- ", InFlag).getNode();");
- InFlagDefined = true;
- } else {
- std::string Decl = (!ResNodeDecled) ? "SDNode *" : "";
- emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName +
+ std::string Decl = (!ResNodeDecled) ? "SDNode *" : "";
+ emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName +
", " + RootName + ".getDebugLoc()" +
", " + getQualifiedName(RR) +
- ", " + RootName + utostr(OpNo) +
- ", InFlag).getNode();");
- }
+ ", " + RootName + utostr(OpNo) + ", InFlag).getNode();");
+ ResNodeDecled = true;
emitCode(ChainName + " = SDValue(ResNode, 0);");
emitCode("InFlag = SDValue(ResNode, 1);");
- ResNodeDecled = true;
}
}
}
}
}
- if (HasInFlag || (HasInI1 && !InFlagDefined)) {
+ if (HasInFlag) {
if (!InFlagDecled) {
emitCode("SDValue InFlag = " + RootName +
".getOperand(" + utostr(OpNo) + ");");