mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-01 17:35:38 +00:00
Add support for instructions with multiple ComplexPatterns, by
adding more information to the temporary variables names so that they don't conflict. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61c6bf37ef
commit
05aae18165
@ -613,8 +613,8 @@ public:
|
|||||||
std::string Fn = CP->getSelectFunc();
|
std::string Fn = CP->getSelectFunc();
|
||||||
unsigned NumOps = CP->getNumOperands();
|
unsigned NumOps = CP->getNumOperands();
|
||||||
for (unsigned i = 0; i < NumOps; ++i) {
|
for (unsigned i = 0; i < NumOps; ++i) {
|
||||||
emitDecl("CPTmp" + utostr(i));
|
emitDecl("CPTmp" + RootName + "_" + utostr(i));
|
||||||
emitCode("SDValue CPTmp" + utostr(i) + ";");
|
emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";");
|
||||||
}
|
}
|
||||||
if (CP->hasProperty(SDNPHasChain)) {
|
if (CP->hasProperty(SDNPHasChain)) {
|
||||||
emitDecl("CPInChain");
|
emitDecl("CPInChain");
|
||||||
@ -625,7 +625,7 @@ public:
|
|||||||
|
|
||||||
std::string Code = Fn + "(" + RootName + ", " + RootName;
|
std::string Code = Fn + "(" + RootName + ", " + RootName;
|
||||||
for (unsigned i = 0; i < NumOps; i++)
|
for (unsigned i = 0; i < NumOps; i++)
|
||||||
Code += ", CPTmp" + utostr(i);
|
Code += ", CPTmp" + RootName + "_" + utostr(i);
|
||||||
if (CP->hasProperty(SDNPHasChain)) {
|
if (CP->hasProperty(SDNPHasChain)) {
|
||||||
ChainName = "Chain" + ChainSuffix;
|
ChainName = "Chain" + ChainSuffix;
|
||||||
Code += ", CPInChain, Chain" + ChainSuffix;
|
Code += ", CPInChain, Chain" + ChainSuffix;
|
||||||
@ -687,8 +687,8 @@ public:
|
|||||||
std::string Fn = CP->getSelectFunc();
|
std::string Fn = CP->getSelectFunc();
|
||||||
unsigned NumOps = CP->getNumOperands();
|
unsigned NumOps = CP->getNumOperands();
|
||||||
for (unsigned i = 0; i < NumOps; ++i) {
|
for (unsigned i = 0; i < NumOps; ++i) {
|
||||||
emitDecl("CPTmp" + utostr(i));
|
emitDecl("CPTmp" + RootName + "_" + utostr(i));
|
||||||
emitCode("SDValue CPTmp" + utostr(i) + ";");
|
emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";");
|
||||||
}
|
}
|
||||||
if (CP->hasProperty(SDNPHasChain)) {
|
if (CP->hasProperty(SDNPHasChain)) {
|
||||||
const SDNodeInfo &PInfo = CGP.getSDNodeInfo(Parent->getOperator());
|
const SDNodeInfo &PInfo = CGP.getSDNodeInfo(Parent->getOperator());
|
||||||
@ -713,7 +713,7 @@ public:
|
|||||||
}
|
}
|
||||||
Code += RootName;
|
Code += RootName;
|
||||||
for (unsigned i = 0; i < NumOps; i++)
|
for (unsigned i = 0; i < NumOps; i++)
|
||||||
Code += ", CPTmp" + utostr(i);
|
Code += ", CPTmp" + RootName + "_" + utostr(i);
|
||||||
if (CP->hasProperty(SDNPHasChain))
|
if (CP->hasProperty(SDNPHasChain))
|
||||||
Code += ", CPInChain, Chain" + ChainSuffix;
|
Code += ", CPInChain, Chain" + ChainSuffix;
|
||||||
emitCheck(Code + ")");
|
emitCheck(Code + ")");
|
||||||
@ -862,7 +862,7 @@ public:
|
|||||||
NodeOps.push_back(Val);
|
NodeOps.push_back(Val);
|
||||||
} else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) {
|
} else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) {
|
||||||
for (unsigned i = 0; i < CP->getNumOperands(); ++i) {
|
for (unsigned i = 0; i < CP->getNumOperands(); ++i) {
|
||||||
NodeOps.push_back("CPTmp" + utostr(i));
|
NodeOps.push_back("CPTmp" + Val + "_" + utostr(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This node, probably wrapped in a SDNodeXForm, behaves like a leaf
|
// This node, probably wrapped in a SDNodeXForm, behaves like a leaf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user