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 | 9e82064924158efccc186e02b369065519b61f65 (patch) | |
tree | 6b025947f3a58e365b693205ea99df36c8f515d8 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | a7ca624028c678eb123a4bfad051f7c40e094ef1 (diff) | |
download | bcm5719-llvm-9e82064924158efccc186e02b369065519b61f65.tar.gz bcm5719-llvm-9e82064924158efccc186e02b369065519b61f65.zip |
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.
llvm-svn: 37644
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index aae27bb882d..34134520d65 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -336,14 +336,13 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // time we see a vreg. if (interval.empty()) { // Remember if the definition can be rematerialized. All load's from fixed - // stack slots are re-materializable. The target may permit other loads to - // be re-materialized as well. + // stack slots are re-materializable. The target may permit other + // instructions to be re-materialized as well. int FrameIdx = 0; if (vi.DefInst && - (tii_->isReMaterializable(vi.DefInst->getOpcode()) || + (tii_->isTriviallyReMaterializable(vi.DefInst) || (tii_->isLoadFromStackSlot(vi.DefInst, FrameIdx) && - mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)) || - tii_->isOtherReMaterializableLoad(vi.DefInst))) + mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)))) interval.remat = vi.DefInst; // Get the Idx of the defining instructions. |