aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-05-28 22:54:52 +0000
committerBill Wendling <isanbard@gmail.com>2008-05-28 22:54:52 +0000
commit8370d38adee63b3a4d87bfe81be4aacc55fe7cda (patch)
tree4689ca3c0b6ee971d3aef6ec8536642eefb377a8 /include
parenta8db14796b22ba7798ef94fc831d56c8a11d4e2a (diff)
downloadexternal_llvm-8370d38adee63b3a4d87bfe81be4aacc55fe7cda.zip
external_llvm-8370d38adee63b3a4d87bfe81be4aacc55fe7cda.tar.gz
external_llvm-8370d38adee63b3a4d87bfe81be4aacc55fe7cda.tar.bz2
Add a flag to indicate that an instruction is as cheap (or cheaper) than a move
instruction to execute. This can be used for transformations (like two-address conversion) to remat an instruction instead of generating a "move" instruction. The idea is to decrease the live ranges and register pressure and all that jazz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetInstrDesc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetInstrDesc.h b/include/llvm/Target/TargetInstrDesc.h
index dbfd55a..c83f8e2 100644
--- a/include/llvm/Target/TargetInstrDesc.h
+++ b/include/llvm/Target/TargetInstrDesc.h
@@ -95,7 +95,8 @@ namespace TID {
Commutable,
ConvertibleTo3Addr,
UsesCustomDAGSchedInserter,
- Rematerializable
+ Rematerializable,
+ CheapAsAMove
};
}
@@ -387,6 +388,15 @@ public:
bool isRematerializable() const {
return Flags & (1 << TID::Rematerializable);
}
+
+ /// isAsCheapAsAMove - Returns true if this instruction has the same cost (or
+ /// less) than a move instruction. This is useful during certain types of
+ /// rematerializations (e.g., during two-address conversion) where we would
+ /// like to remat the instruction, but not if it costs more than moving the
+ /// instruction into the appropriate register.
+ bool isAsCheapAsAMove() const {
+ return Flags & (1 << TID::CheapAsAMove);
+ }
};
} // end namespace llvm