summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-23 22:44:10 +0000
committerOwen Anderson <resistor@mac.com>2010-09-23 22:44:10 +0000
commit6e0e8d7d647bfc3ff39848809357d7e49a75fa31 (patch)
treeb3a6d8616558607e0edddece2462a0007dde2c2c
parent16e264c5462ca476f96c36390b5263780d902a33 (diff)
downloadbcm5719-llvm-6e0e8d7d647bfc3ff39848809357d7e49a75fa31.tar.gz
bcm5719-llvm-6e0e8d7d647bfc3ff39848809357d7e49a75fa31.zip
Add an TargetInstrDesc bit to indicate that a given instruction is a conditional move.
Not intended functionality change, as nothing uses this yet. llvm-svn: 114702
-rw-r--r--llvm/include/llvm/Target/Target.td1
-rw-r--r--llvm/include/llvm/Target/TargetInstrDesc.h7
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.cpp1
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h1
-rw-r--r--llvm/utils/TableGen/InstrInfoEmitter.cpp1
5 files changed, 11 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/Target.td b/llvm/include/llvm/Target/Target.td
index b141a77df4f..7d53123877b 100644
--- a/llvm/include/llvm/Target/Target.td
+++ b/llvm/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/llvm/include/llvm/Target/TargetInstrDesc.h b/llvm/include/llvm/Target/TargetInstrDesc.h
index a127aed8f6d..ee1ac5ff5d8 100644
--- a/llvm/include/llvm/Target/TargetInstrDesc.h
+++ b/llvm/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/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp
index 01a1fe11f53..b36cf983a5f 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.cpp
+++ b/llvm/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/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index b02d0d38f97..e2e29b16cf0 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/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/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 4d3aa5e621c..ce066b96c0e 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/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)";
OpenPOWER on IntegriCloud