From: Evan Cheng Date: Mon, 19 Dec 2005 22:40:04 +0000 (+0000) Subject: Fix another bug related to chain / flag. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f9fc25db32de9fe16134f0d631acc3c84487259c;p=oota-llvm.git Fix another bug related to chain / flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24868 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 0476bd4171e..e14ab6d3942 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -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,