[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

Evan Cheng evan.cheng at apple.com
Fri Dec 9 16:09:29 PST 2005



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.91 -> 1.92
---
Log message:

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


---
Diffs of the changes:  (+6 -4)

 DAGISelEmitter.cpp |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.91 llvm/utils/TableGen/DAGISelEmitter.cpp:1.92
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.91	Fri Dec  9 16:57:42 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Fri Dec  9 18:09:17 2005
@@ -1779,10 +1779,11 @@
     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 @@
         }
         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






More information about the llvm-commits mailing list