Fix another bug related to chain / flag.

llvm-svn: 24868
This commit is contained in:
Evan Cheng 2005-12-19 22:40:04 +00:00
parent 1d9b671de0
commit 19b9f15377
1 changed files with 20 additions and 8 deletions

View File

@ -2107,21 +2107,33 @@ public:
OS << ");\n";
unsigned ValNo = 0;
for (unsigned i = 0; i < NumResults; i++)
OS << " CodeGenMap[N.getValue(" << ValNo++ << ")] = Result;\n";
for (unsigned i = 0; i < NumResults; i++) {
OS << " CodeGenMap[N.getValue(" << ValNo << ")] = Result"
<< ".getValue(" << ValNo << ");\n";
ValNo++;
}
if (II.hasCtrlDep) {
OS << " Chain ";
if (NodeHasChain(Pattern, ISE))
OS << "= CodeGenMap[N.getValue(" << ValNo << ")] ";
OS << "= CodeGenMap[N.getValue(" << ValNo + NumImpResults << ")] ";
for (unsigned j = 0, e = FoldedChains.size(); j < e; j++)
OS << "= CodeGenMap[" << FoldedChains[j].first << ".getValue("
<< FoldedChains[j].second << ")] ";
OS << "= Result.getValue(" << ValNo++ << ");\n";
}
for (unsigned i = 0; i < NumImpResults; i++) {
OS << " CodeGenMap[N.getValue(" << ValNo << ")] = Result";
OS << ".getValue(" << ValNo++ << ");\n";
OS << "= Result.getValue(" << ValNo << ");\n";
for (unsigned i = 0; i < NumImpResults; i++) {
OS << " CodeGenMap[N.getValue(" << ValNo << ")] = Result";
OS << ".getValue(" << ValNo+1 << ");\n";
ValNo++;
}
} else {
for (unsigned i = 0; i < NumImpResults; i++) {
OS << " CodeGenMap[N.getValue(" << ValNo << ")] = Result";
OS << ".getValue(" << ValNo << ");\n";
ValNo++;
}
}
OS << " return Result.getValue(N.ResNo);\n";
} else {
// If this instruction is the root, and if there is only one use of it,