aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2005-12-19 22:40:04 +0000
committerEvan Cheng <evan.cheng@apple.com>2005-12-19 22:40:04 +0000
commitf9fc25db32de9fe16134f0d631acc3c84487259c (patch)
tree9f5521ac46238267d1b49a57d9fddd1a8ce10c1d /utils/TableGen
parentfcaa9957c9181e1de8c82f2cd808e3c457acc7ba (diff)
downloadexternal_llvm-f9fc25db32de9fe16134f0d631acc3c84487259c.zip
external_llvm-f9fc25db32de9fe16134f0d631acc3c84487259c.tar.gz
external_llvm-f9fc25db32de9fe16134f0d631acc3c84487259c.tar.bz2
Fix another bug related to chain / flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 0476bd4..e14ab6d 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,