teach tblgen to be smart enough to handle tglobaladdr nodes

llvm-svn: 24391
This commit is contained in:
Chris Lattner 2005-11-17 07:39:45 +00:00
parent 595088aa0f
commit 2a230e1c1a
1 changed files with 2 additions and 0 deletions

View File

@ -1668,6 +1668,8 @@ CodeGenPatternResult(TreePatternNode *N, unsigned &Ctr,
OS << ResNo << "C = cast<ConstantSDNode>(" << Val << ")->getValue();\n"; OS << ResNo << "C = cast<ConstantSDNode>(" << Val << ")->getValue();\n";
OS << " SDOperand Tmp" << ResNo << " = CurDAG->getTargetConstant(Tmp" OS << " SDOperand Tmp" << ResNo << " = CurDAG->getTargetConstant(Tmp"
<< ResNo << "C, MVT::" << getEnumName(N->getType()) << ");\n"; << ResNo << "C, MVT::" << getEnumName(N->getType()) << ");\n";
} else if (!N->isLeaf() && N->getOperator()->getName() == "tglobaladdr") {
OS << " SDOperand Tmp" << ResNo << " = " << Val << ";\n";
} else { } else {
OS << " SDOperand Tmp" << ResNo << " = Select(" << Val << ");\n"; OS << " SDOperand Tmp" << ResNo << " = Select(" << Val << ");\n";
} }