diff options
author | Dan Gohman <gohman@apple.com> | 2007-06-19 01:48:05 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-06-19 01:48:05 +0000 |
commit | 82a87a01723c095176c6940bcc63d3a7c8007b4b (patch) | |
tree | cb6bdf78002b48d594f2803783ba8c3d361d8a01 /include/llvm/Target/TargetInstrInfo.h | |
parent | eaa91b0a1fc68984aae51f3c4b0cf29b38f89dac (diff) | |
download | external_llvm-82a87a01723c095176c6940bcc63d3a7c8007b4b.zip external_llvm-82a87a01723c095176c6940bcc63d3a7c8007b4b.tar.gz external_llvm-82a87a01723c095176c6940bcc63d3a7c8007b4b.tar.bz2 |
Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetInstrInfo.h')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 2a1843f..339b391 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -78,10 +78,6 @@ const unsigned M_VARIABLE_OPS = 1 << 11; // controls execution. It may be set to 'always'. const unsigned M_PREDICABLE = 1 << 12; -// M_REMATERIALIZIBLE - Set if this instruction can be trivally re-materialized -// at any time, e.g. constant generation, load from constant pool. -const unsigned M_REMATERIALIZIBLE = 1 << 13; - // M_CLOBBERS_PRED - Set if this instruction may clobbers the condition code // register and / or registers that are used to predicate instructions. const unsigned M_CLOBBERS_PRED = 1 << 14; @@ -264,10 +260,6 @@ public: return get(Opcode).Flags & M_PREDICABLE; } - bool isReMaterializable(MachineOpCode Opcode) const { - return get(Opcode).Flags & M_REMATERIALIZIBLE; - } - bool clobbersPredicate(MachineOpCode Opcode) const { return get(Opcode).Flags & M_CLOBBERS_PRED; } @@ -309,13 +301,13 @@ public: return 0; } - /// isOtherReMaterializableLoad - If the specified machine instruction is a - /// direct load that is trivially rematerializable, not counting loads from - /// stack slots, return true. If not, return false. This predicate must + /// isTriviallyReMaterializable - If the specified machine instruction can + /// be trivally re-materialized at any time, e.g. constant generation or + /// loads from constant pools. If not, return false. This predicate must /// return false if the instruction has any side effects other than /// producing the value from the load, or if it requres any address /// registers that are not always available. - virtual bool isOtherReMaterializableLoad(MachineInstr *MI) const { + virtual bool isTriviallyReMaterializable(MachineInstr *MI) const { return false; } |