Add an TargetInstrDesc bit to indicate that a given instruction is a conditional...
authorOwen Anderson <resistor@mac.com>
Thu, 23 Sep 2010 22:44:10 +0000 (22:44 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 23 Sep 2010 22:44:10 +0000 (22:44 +0000)
Not intended functionality change, as nothing uses this yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114702 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/Target.td
include/llvm/Target/TargetInstrDesc.h
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h
utils/TableGen/InstrInfoEmitter.cpp

index b141a77df4f20539e2b1f6b55c85e668bc40f77c..7d53123877b9f65930dd9c4e69e2a144b79156f0 100644 (file)
@@ -201,6 +201,7 @@ class Instruction {
   bit isCompare    = 0;     // Is this instruction a comparison instruction?
   bit isBarrier    = 0;     // Can control flow fall through this instruction?
   bit isCall       = 0;     // Is this instruction a call instruction?
+  bit isConditionalMove = 0; // Is this instruction a conditional move instr?
   bit canFoldAsLoad = 0;    // Can this be folded as a simple memory operand?
   bit mayLoad      = 0;     // Is it possible for this inst to read memory?
   bit mayStore     = 0;     // Is it possible for this inst to write memory?
index a127aed8f6dfcd59e266e976e416f6b1db44cf73..ee1ac5ff5d88a601ea86602d6f7966bbd418545b 100644 (file)
@@ -99,6 +99,7 @@ namespace TID {
     HasOptionalDef,
     Return,
     Call,
+    ConditionalMove,
     Barrier,
     Terminator,
     Branch,
@@ -352,6 +353,12 @@ public:
     return Flags & (1 << TID::Compare);
   }
   
+  /// isConditionalMove - Return true if this instruction can be considered a
+  /// conditional move, like CMOV on X86 or MOVCC on ARM.
+  bool isConditionalMove() const {
+    return Flags & (1 << TID::ConditionalMove);
+  }
+  
   /// isNotDuplicable - Return true if this instruction cannot be safely
   /// duplicated.  For example, if the instruction has a unique labels attached
   /// to it, duplicating it would cause multiple definition errors.
index 01a1fe11f5318f0218b04a30cface0830f4290d6..b36cf983a5f4da40ede12e742cc11c7948850cba 100644 (file)
@@ -103,6 +103,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
   isBranch     = R->getValueAsBit("isBranch");
   isIndirectBranch = R->getValueAsBit("isIndirectBranch");
   isCompare    = R->getValueAsBit("isCompare");
+  isConditionalMove = R->getValueAsBit("isConditionalMove");
   isBarrier    = R->getValueAsBit("isBarrier");
   isCall       = R->getValueAsBit("isCall");
   canFoldAsLoad = R->getValueAsBit("canFoldAsLoad");
index b02d0d38f975dbae0ef2604537e369351eea4ce7..e2e29b16cf07236667018f0e88ec08b9588acba2 100644 (file)
@@ -124,6 +124,7 @@ namespace llvm {
     bool isBranch;
     bool isIndirectBranch;
     bool isCompare;
+    bool isConditionalMove;
     bool isBarrier;
     bool isCall;
     bool canFoldAsLoad;
index 4d3aa5e621c9c749347ed86d1d66fd6ce756019f..ce066b96c0e5bba0fd95840dc8eb0653c9ddfcae 100644 (file)
@@ -274,6 +274,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
   if (Inst.isBarrier)          OS << "|(1<<TID::Barrier)";
   if (Inst.hasDelaySlot)       OS << "|(1<<TID::DelaySlot)";
   if (Inst.isCall)             OS << "|(1<<TID::Call)";
+  if (Inst.isConditionalMove)  OS << "|(1<<TID::ConditionalMove)";
   if (Inst.canFoldAsLoad)      OS << "|(1<<TID::FoldableAsLoad)";
   if (Inst.mayLoad)            OS << "|(1<<TID::MayLoad)";
   if (Inst.mayStore)           OS << "|(1<<TID::MayStore)";