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 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | eaa91b0a1fc68984aae51f3c4b0cf29b38f89dac (diff) |
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 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index aae27bb882..34134520d6 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/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. |