summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCInstrDesc.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-16 23:11:47 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-16 23:11:47 +0000
commitf2c64ef519b38a4328809b27b4a3a8e0c26e9709 (patch)
treece3233b4960acdefe47ab3644925c8196a84e3c3 /include/llvm/MC/MCInstrDesc.h
parent05b2bc8781d9af403a257599613e12cb8fef19e8 (diff)
downloadllvm-f2c64ef519b38a4328809b27b4a3a8e0c26e9709.tar.gz
llvm-f2c64ef519b38a4328809b27b4a3a8e0c26e9709.tar.bz2
llvm-f2c64ef519b38a4328809b27b4a3a8e0c26e9709.tar.xz
Add an MCID::Select flag and TII hooks for optimizing selects.
Select instructions pick one of two virtual registers based on a condition, like x86 cmov. On targets like ARM that support predication, selects can sometimes be eliminated by predicating the instruction defining one of the operands. Teach PeepholeOptimizer to recognize select instructions, and ask the target to optimize them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCInstrDesc.h')
-rw-r--r--include/llvm/MC/MCInstrDesc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/MC/MCInstrDesc.h b/include/llvm/MC/MCInstrDesc.h
index 186612d904..dbf16d8700 100644
--- a/include/llvm/MC/MCInstrDesc.h
+++ b/include/llvm/MC/MCInstrDesc.h
@@ -107,6 +107,7 @@ namespace MCID {
Compare,
MoveImm,
Bitcast,
+ Select,
DelaySlot,
FoldableAsLoad,
MayLoad,
@@ -282,6 +283,12 @@ public:
return Flags & (1 << MCID::Bitcast);
}
+ /// isSelect - Return true if this is a select instruction.
+ ///
+ bool isSelect() const {
+ return Flags & (1 << MCID::Select);
+ }
+
/// 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.