diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2005-12-19 22:40:04 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2005-12-19 22:40:04 +0000 |
| commit | 19b9f15377cd181eac4af22eeb3fe51bef946af7 (patch) | |
| tree | 38d65f76cb3ac870acfe07f9243a14b46a77db78 /llvm/utils | |
| parent | 1d9b671de0b861c5f676a5312eca0f3064d4c090 (diff) | |
| download | bcm5719-llvm-19b9f15377cd181eac4af22eeb3fe51bef946af7.tar.gz bcm5719-llvm-19b9f15377cd181eac4af22eeb3fe51bef946af7.zip | |
Fix another bug related to chain / flag.
llvm-svn: 24868
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index 0476bd4171e..e14ab6d3942 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/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, |

