* Do not allow nodes which produce chain results (e.g. loads) to be folded if
[oota-llvm.git] / utils / TableGen / CodeGenInstruction.h
index 82df28ae2d88031b9e88eed8f72aff7b8feff445..cee55d2856524a17b497674b7a0249b61d2711ec 100644 (file)
@@ -1,10 +1,10 @@
 //===- CodeGenInstruction.h - Instruction Class Wrapper ---------*- C++ -*-===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file defines a wrapper class for the 'Instruction' TableGen class.
@@ -21,6 +21,7 @@
 
 namespace llvm {
   class Record;
+  class DagInit;
 
   struct CodeGenInstruction {
     Record *TheDef;            // The actual record defining this instruction.
@@ -35,11 +36,8 @@ namespace llvm {
     /// operand list for a tablegen instruction.
     struct OperandInfo {
       /// Rec - The definition this operand is declared as.
-      Record *Rec;
-
-      /// Ty - The MachineValueType of the operand.
       ///
-      MVT::ValueType Ty;
+      Record *Rec;
 
       /// Name - If this operand was assigned a symbolic name, this is it,
       /// otherwise, it's empty.
@@ -56,12 +54,18 @@ namespace llvm {
       /// OperandList may not match the MachineInstr operand num.  Until it
       /// does, this contains the MI operand index of this operand.
       unsigned MIOperandNo;
+      unsigned MINumOperands;   // The number of operands.
+
+      /// MIOperandInfo - Default MI operand type. Note an operand may be made
+      /// up of multiple MI operands.
+      DagInit *MIOperandInfo;
 
-      OperandInfo(Record *R, MVT::ValueType T, const std::string &N,
-                  const std::string &PMN, unsigned MION)
-        : Rec(R), Ty(T), Name(N), PrinterMethodName(PMN), MIOperandNo(MION) {}
+      OperandInfo(Record *R, const std::string &N, const std::string &PMN, 
+                  unsigned MION, unsigned MINO, DagInit *MIOI)
+        : Rec(R), Name(N), PrinterMethodName(PMN), MIOperandNo(MION),
+          MINumOperands(MINO), MIOperandInfo(MIOI) {}
     };
-    
+
     /// OperandList - The list of declared operands, along with their declared
     /// type (which is a record).
     std::vector<OperandInfo> OperandList;
@@ -74,8 +78,13 @@ namespace llvm {
     bool isLoad;
     bool isStore;
     bool isTwoAddress;
+    bool isConvertibleToThreeAddress;
+    bool isCommutable;
     bool isTerminator;
     bool hasDelaySlot;
+    bool usesCustomDAGSchedInserter;
+    bool hasVariableNumberOfOperands;
+    bool hasCtrlDep;
 
     CodeGenInstruction(Record *R, const std::string &AsmStr);