projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added support to have TableGen provide information if an intrinsic (core
[oota-llvm.git]
/
utils
/
TableGen
/
DAGISelEmitter.cpp
diff --git
a/utils/TableGen/DAGISelEmitter.cpp
b/utils/TableGen/DAGISelEmitter.cpp
index ace1d7646f5932c0436a85eab76af31c33952344..43513525579aaed2f8cc5f42fe453b51f73e128b 100644
(file)
--- a/
utils/TableGen/DAGISelEmitter.cpp
+++ b/
utils/TableGen/DAGISelEmitter.cpp
@@
-925,7
+925,8
@@
public:
TreePatternNode *InstPatNode =
isRoot ? (InstPat ? InstPat->getTree(0) : Pattern)
: (InstPat ? InstPat->getTree(0) : NULL);
TreePatternNode *InstPatNode =
isRoot ? (InstPat ? InstPat->getTree(0) : Pattern)
: (InstPat ? InstPat->getTree(0) : NULL);
- if (InstPatNode && InstPatNode->getOperator()->getName() == "set") {
+ if (InstPatNode && !InstPatNode->isLeaf() &&
+ InstPatNode->getOperator()->getName() == "set") {
InstPatNode = InstPatNode->getChild(InstPatNode->getNumChildren()-1);
}
bool IsVariadic = isRoot && II.isVariadic;
InstPatNode = InstPatNode->getChild(InstPatNode->getNumChildren()-1);
}
bool IsVariadic = isRoot && II.isVariadic;
@@
-977,7
+978,8
@@
public:
emitCode("}");
}
emitCode("InChains.push_back(" + ChainName + ");");
emitCode("}");
}
emitCode("InChains.push_back(" + ChainName + ");");
- emitCode(ChainName + " = CurDAG->getNode(ISD::TokenFactor, MVT::Other, "
+ emitCode(ChainName + " = CurDAG->getNode(ISD::TokenFactor, "
+ "N.getDebugLoc(), MVT::Other, "
"&InChains[0], InChains.size());");
if (GenDebug) {
emitCode("CurDAG->setSubgraphColor(" + ChainName +".getNode(), \"yellow\");");
"&InChains[0], InChains.size());");
if (GenDebug) {
emitCode("CurDAG->setSubgraphColor(" + ChainName +".getNode(), \"yellow\");");
@@
-1058,6
+1060,10
@@
public:
std::string Code = "Opc" + utostr(OpcNo);
std::string Code = "Opc" + utostr(OpcNo);
+ if (!isRoot || (InputHasChain && !NodeHasChain))
+ // For call to "getTargetNode()".
+ Code += ", N.getDebugLoc()";
+
emitOpcode(II.Namespace + "::" + II.TheDef->getName());
// Output order: results, chain, flags
emitOpcode(II.Namespace + "::" + II.TheDef->getName());
// Output order: results, chain, flags
@@
-1390,6
+1396,7
@@
private:
}
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();");
ResNodeDecled = true;
", " + getQualifiedName(RR) +
", " + RootName + utostr(OpNo) + ", InFlag).getNode();");
ResNodeDecled = true;
@@
-1824,9
+1831,6
@@
void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
} else
OpVTI->second.push_back(OpVTStr);
} else
OpVTI->second.push_back(OpVTStr);
- OS << "SDNode *Select_" << getLegalCName(OpName)
- << OpVTStr << "(const SDValue &N) {\n";
-
// We want to emit all of the matching code now. However, we want to emit
// the matches in order of minimal cost. Sort the patterns so the least
// cost one is at the start.
// We want to emit all of the matching code now. However, we want to emit
// the matches in order of minimal cost. Sort the patterns so the least
// cost one is at the start.
@@
-1868,6
+1872,9
@@
void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
// Next, reverse the list of patterns itself for the same reason.
std::reverse(CodeForPatterns.begin(), CodeForPatterns.end());
// Next, reverse the list of patterns itself for the same reason.
std::reverse(CodeForPatterns.begin(), CodeForPatterns.end());
+ OS << "SDNode *Select_" << getLegalCName(OpName)
+ << OpVTStr << "(const SDValue &N) {\n";
+
// Emit all of the patterns now, grouped together to share code.
EmitPatterns(CodeForPatterns, 2, OS);
// Emit all of the patterns now, grouped together to share code.
EmitPatterns(CodeForPatterns, 2, OS);
@@
-1896,8
+1903,8
@@
void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
<< " std::vector<MVT> VTs;\n"
<< " VTs.push_back(MVT::Other);\n"
<< " VTs.push_back(MVT::Flag);\n"
<< " std::vector<MVT> VTs;\n"
<< " VTs.push_back(MVT::Other);\n"
<< " VTs.push_back(MVT::Flag);\n"
- << " SDValue New = CurDAG->getNode(ISD::INLINEASM,
VTs, &Ops[0]
, "
- "Ops.size());\n"
+ << " SDValue New = CurDAG->getNode(ISD::INLINEASM,
N.getDebugLoc()
, "
+ "
VTs, &Ops[0],
Ops.size());\n"
<< " return New.getNode();\n"
<< "}\n\n";
<< " return New.getNode();\n"
<< "}\n\n";