From: Evan Cheng Date: Sat, 10 Dec 2005 00:09:17 +0000 (+0000) Subject: For instructions which produce no result, e.g. store, chain's Resno == 0. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1129e87ff45324af19241e2106299f0a724c9f1a;p=oota-llvm.git For instructions which produce no result, e.g. store, chain's Resno == 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24652 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 285c10f0f5d..3d64fa7bbc5 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -1779,10 +1779,11 @@ public: if (NodeHasChain(N, ISE)) { OpNo = 1; if (!isRoot) { + const SDNodeInfo &CInfo = ISE.getSDNodeInfo(N->getOperator()); OS << " if (!" << RootName << ".hasOneUse()) goto P" << PatternNo << "Fail; // Multiple uses of actual result?\n"; OS << " if (CodeGenMap.count(" << RootName - << ".getValue(1))) goto P" + << ".getValue(" << CInfo.getNumResults() << "))) goto P" << PatternNo << "Fail; // Already selected for a chain use?\n"; } if (InnerChain.empty()) { @@ -2024,10 +2025,11 @@ public: } OS << " Chain "; if (NodeHasChain(LHS, ISE)) - OS << "= CodeGenMap[N.getValue(1)] "; + OS << "= CodeGenMap[N.getValue(" << NumResults << ")] "; for (unsigned j = 0, e = FoldedChains.size(); j < e; j++) - OS << "= CodeGenMap[" << FoldedChains[j] << ".getValue(1)] "; - OS << "= Result.getValue(1);\n"; + OS << "= CodeGenMap[" << FoldedChains[j] << ".getValue(" + << NumResults << ")] "; + OS << "= Result.getValue(" << NumResults << ");\n"; if (NumResults == 0) OS << " return Chain;\n"; else