[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jan 19 10:01:53 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.42 -> 1.43
---
Log message:

Know some identities about tokenfactor nodes.


---
Diffs of the changes:  (+11 -0)

Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.42 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.43
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.42	Wed Jan 19 11:29:49 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Wed Jan 19 12:01:40 2005
@@ -549,6 +549,10 @@
                                 SDOperand N1, SDOperand N2) {
 #ifndef NDEBUG
   switch (Opcode) {
+  case ISD::TokenFactor:
+    assert(VT == MVT::Other && N1.getValueType() == MVT::Other &&
+           N2.getValueType() == MVT::Other && "Invalid token factor!");
+    break;
   case ISD::AND:
   case ISD::OR:
   case ISD::XOR:
@@ -739,6 +743,13 @@
 
   // Finally, fold operations that do not require constants.
   switch (Opcode) {
+  case ISD::TokenFactor:
+    if (N1.getOpcode() == ISD::EntryToken)
+      return N2;
+    if (N2.getOpcode() == ISD::EntryToken)
+      return N1;
+    break;
+
   case ISD::AND:
   case ISD::OR:
     if (SetCCSDNode *LHS = dyn_cast<SetCCSDNode>(N1.Val))






More information about the llvm-commits mailing list