forked from OSchip/llvm-project
parent
2617de498d
commit
3556d849da
|
@ -509,7 +509,7 @@ void DAGISelEmitter::ParseNodeTransforms(std::ostream &OS) {
|
||||||
SDNodeXForms.insert(std::make_pair(XFormNode,
|
SDNodeXForms.insert(std::make_pair(XFormNode,
|
||||||
std::make_pair(SDNode, Code)));
|
std::make_pair(SDNode, Code)));
|
||||||
|
|
||||||
if (!Code.empty()) {
|
if (0 && !Code.empty()) {
|
||||||
std::string ClassName = getSDNodeInfo(SDNode).getSDClassName();
|
std::string ClassName = getSDNodeInfo(SDNode).getSDClassName();
|
||||||
const char *C2 = ClassName == "SDNode" ? "N" : "inN";
|
const char *C2 = ClassName == "SDNode" ? "N" : "inN";
|
||||||
|
|
||||||
|
@ -592,6 +592,12 @@ void DAGISelEmitter::ParseAndResolvePatternFragments(std::ostream &OS) {
|
||||||
OS << Code << "\n}\n";
|
OS << Code << "\n}\n";
|
||||||
P->getOnlyTree()->setPredicateFn("Predicate_"+Fragments[i]->getName());
|
P->getOnlyTree()->setPredicateFn("Predicate_"+Fragments[i]->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there is a node transformation corresponding to this, keep track of
|
||||||
|
// it.
|
||||||
|
Record *Transform = Fragments[i]->getValueAsDef("OperandTransform");
|
||||||
|
if (!getSDNodeTransform(Transform).second.empty()) // not noop xform?
|
||||||
|
P->getOnlyTree()->setTransformFn("Transform_"+Transform->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
OS << "\n\n";
|
OS << "\n\n";
|
||||||
|
|
|
@ -302,6 +302,11 @@ public:
|
||||||
return PatternFragments.find(R)->second;
|
return PatternFragments.find(R)->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::pair<Record*, std::string> &getSDNodeTransform(Record *R) const {
|
||||||
|
assert(SDNodeXForms.count(R) && "Invalid transform!");
|
||||||
|
return SDNodeXForms.find(R)->second;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ParseNodeInfo();
|
void ParseNodeInfo();
|
||||||
void ParseNodeTransforms(std::ostream &OS);
|
void ParseNodeTransforms(std::ostream &OS);
|
||||||
|
|
Loading…
Reference in New Issue