From: Owen Anderson Date: Thu, 23 Sep 2010 22:44:10 +0000 (+0000) Subject: Add an TargetInstrDesc bit to indicate that a given instruction is a conditional... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5716180b1a863d345127fa8f9dfe0a931ab7370c;p=oota-llvm.git Add an TargetInstrDesc bit to indicate that a given instruction is a conditional move. 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 --- diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index b141a77df4f..7d53123877b 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -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? diff --git a/include/llvm/Target/TargetInstrDesc.h b/include/llvm/Target/TargetInstrDesc.h index a127aed8f6d..ee1ac5ff5d8 100644 --- a/include/llvm/Target/TargetInstrDesc.h +++ b/include/llvm/Target/TargetInstrDesc.h @@ -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. diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index 01a1fe11f53..b36cf983a5f 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -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"); diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index b02d0d38f97..e2e29b16cf0 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -124,6 +124,7 @@ namespace llvm { bool isBranch; bool isIndirectBranch; bool isCompare; + bool isConditionalMove; bool isBarrier; bool isCall; bool canFoldAsLoad; diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index 4d3aa5e621c..ce066b96c0e 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -274,6 +274,7 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num, if (Inst.isBarrier) OS << "|(1<