Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.145 -> 1.146
---
Log message:

(store (op (load ...)), ...)
If store's chain operand is load, then use load's chain operand instead. If
it isn't (likely a TokenFactor), then do not allow the folding.


---
Diffs of the changes:  (+10 -3)

 DAGISelEmitter.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.145 
llvm/utils/TableGen/DAGISelEmitter.cpp:1.146
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.145        Thu Jan 26 17:08:55 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp      Fri Jan 27 16:13:45 2006
@@ -1931,9 +1931,16 @@
              << ".getValue(" << CInfo.getNumResults() << "))) goto P"
              << PatternNo << "Fail;   // Already selected for a chain use?\n";
       }
-      if (NodeHasChain && !FoundChain) {
-        OS << "      SDOperand Chain = " << RootName << ".getOperand(0);\n";
-        FoundChain = true;
+      if (NodeHasChain) {
+        if (!FoundChain) {
+          OS << "      SDOperand Chain = " << RootName << ".getOperand(0);\n";
+          FoundChain = true;
+        } else {
+          OS << "      if (Chain.Val == " << RootName << ".Val)\n";
+          OS << "        Chain = " << RootName << ".getOperand(0);\n";
+          OS << "      else\n";
+          OS << "        goto P" << PatternNo << "Fail;\n";
+        }
       }
     }
 



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to