diff options
author | Owen Anderson <resistor@mac.com> | 2010-09-23 22:44:10 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-09-23 22:44:10 +0000 |
commit | 5716180b1a863d345127fa8f9dfe0a931ab7370c (patch) | |
tree | a4ef16abce9e17a85b87603a5ba0cae14349546d | |
parent | 823d9a53a426a2612bd73eda610fee75962ebd05 (diff) | |
download | llvm-5716180b1a863d345127fa8f9dfe0a931ab7370c.tar.gz llvm-5716180b1a863d345127fa8f9dfe0a931ab7370c.tar.bz2 llvm-5716180b1a863d345127fa8f9dfe0a931ab7370c.tar.xz |
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
-rw-r--r-- | include/llvm/Target/Target.td | 1 | ||||
-rw-r--r-- | include/llvm/Target/TargetInstrDesc.h | 7 | ||||
-rw-r--r-- | utils/TableGen/CodeGenInstruction.cpp | 1 | ||||
-rw-r--r-- | utils/TableGen/CodeGenInstruction.h | 1 | ||||
-rw-r--r-- | utils/TableGen/InstrInfoEmitter.cpp | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index b141a77df4..7d53123877 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 a127aed8f6..ee1ac5ff5d 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 01a1fe11f5..b36cf983a5 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 b02d0d38f9..e2e29b16cf 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 4d3aa5e621..ce066b96c0 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<<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)"; |