For instructions which produce no result, e.g. store, chain's Resno == 0.

llvm-svn: 24652
This commit is contained in:
Evan Cheng 2005-12-10 00:09:17 +00:00
parent ade6f9a255
commit bac252c289
1 changed files with 6 additions and 4 deletions

View File

@ -1779,10 +1779,11 @@ public:
if (NodeHasChain(N, ISE)) { if (NodeHasChain(N, ISE)) {
OpNo = 1; OpNo = 1;
if (!isRoot) { if (!isRoot) {
const SDNodeInfo &CInfo = ISE.getSDNodeInfo(N->getOperator());
OS << " if (!" << RootName << ".hasOneUse()) goto P" OS << " if (!" << RootName << ".hasOneUse()) goto P"
<< PatternNo << "Fail; // Multiple uses of actual result?\n"; << PatternNo << "Fail; // Multiple uses of actual result?\n";
OS << " if (CodeGenMap.count(" << RootName OS << " if (CodeGenMap.count(" << RootName
<< ".getValue(1))) goto P" << ".getValue(" << CInfo.getNumResults() << "))) goto P"
<< PatternNo << "Fail; // Already selected for a chain use?\n"; << PatternNo << "Fail; // Already selected for a chain use?\n";
} }
if (InnerChain.empty()) { if (InnerChain.empty()) {
@ -2024,10 +2025,11 @@ public:
} }
OS << " Chain "; OS << " Chain ";
if (NodeHasChain(LHS, ISE)) if (NodeHasChain(LHS, ISE))
OS << "= CodeGenMap[N.getValue(1)] "; OS << "= CodeGenMap[N.getValue(" << NumResults << ")] ";
for (unsigned j = 0, e = FoldedChains.size(); j < e; j++) for (unsigned j = 0, e = FoldedChains.size(); j < e; j++)
OS << "= CodeGenMap[" << FoldedChains[j] << ".getValue(1)] "; OS << "= CodeGenMap[" << FoldedChains[j] << ".getValue("
OS << "= Result.getValue(1);\n"; << NumResults << ")] ";
OS << "= Result.getValue(" << NumResults << ");\n";
if (NumResults == 0) if (NumResults == 0)
OS << " return Chain;\n"; OS << " return Chain;\n";
else else