[llvm-commits] [llvm] r62296 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Dan Gohman
gohman at apple.com
Thu Jan 15 18:05:52 PST 2009
Author: djg
Date: Thu Jan 15 20:05:52 2009
New Revision: 62296
URL: http://llvm.org/viewvc/llvm-project?rev=62296&view=rev
Log:
Add support for instructions with multiple ComplexPatterns, by
adding more information to the temporary variables names so that
they don't conflict.
Modified:
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=62296&r1=62295&r2=62296&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Jan 15 20:05:52 2009
@@ -613,8 +613,8 @@
std::string Fn = CP->getSelectFunc();
unsigned NumOps = CP->getNumOperands();
for (unsigned i = 0; i < NumOps; ++i) {
- emitDecl("CPTmp" + utostr(i));
- emitCode("SDValue CPTmp" + utostr(i) + ";");
+ emitDecl("CPTmp" + RootName + "_" + utostr(i));
+ emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";");
}
if (CP->hasProperty(SDNPHasChain)) {
emitDecl("CPInChain");
@@ -625,7 +625,7 @@
std::string Code = Fn + "(" + RootName + ", " + RootName;
for (unsigned i = 0; i < NumOps; i++)
- Code += ", CPTmp" + utostr(i);
+ Code += ", CPTmp" + RootName + "_" + utostr(i);
if (CP->hasProperty(SDNPHasChain)) {
ChainName = "Chain" + ChainSuffix;
Code += ", CPInChain, Chain" + ChainSuffix;
@@ -687,8 +687,8 @@
std::string Fn = CP->getSelectFunc();
unsigned NumOps = CP->getNumOperands();
for (unsigned i = 0; i < NumOps; ++i) {
- emitDecl("CPTmp" + utostr(i));
- emitCode("SDValue CPTmp" + utostr(i) + ";");
+ emitDecl("CPTmp" + RootName + "_" + utostr(i));
+ emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";");
}
if (CP->hasProperty(SDNPHasChain)) {
const SDNodeInfo &PInfo = CGP.getSDNodeInfo(Parent->getOperator());
@@ -713,7 +713,7 @@
}
Code += RootName;
for (unsigned i = 0; i < NumOps; i++)
- Code += ", CPTmp" + utostr(i);
+ Code += ", CPTmp" + RootName + "_" + utostr(i);
if (CP->hasProperty(SDNPHasChain))
Code += ", CPInChain, Chain" + ChainSuffix;
emitCheck(Code + ")");
@@ -862,7 +862,7 @@
NodeOps.push_back(Val);
} else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) {
for (unsigned i = 0; i < CP->getNumOperands(); ++i) {
- NodeOps.push_back("CPTmp" + utostr(i));
+ NodeOps.push_back("CPTmp" + Val + "_" + utostr(i));
}
} else {
// This node, probably wrapped in a SDNodeXForm, behaves like a leaf
More information about the llvm-commits
mailing list