diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetInstrDesc.h | 12 |
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 |