diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-12-12 23:12:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-12-12 23:12:09 +0000 |
commit | 6e68381e02b100149eb95bbc5c2ae26696e96a51 (patch) | |
tree | bb27fb8c436fdf1d1f8fb515c724c165ccf5b968 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | fde556745bfc6ec9dae2d1dbca3b6f734d3f842c (diff) | |
download | bcm5719-llvm-6e68381e02b100149eb95bbc5c2ae26696e96a51.tar.gz bcm5719-llvm-6e68381e02b100149eb95bbc5c2ae26696e96a51.zip |
Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
llvm-svn: 44960
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 0761e05a268..3496b6f6eb7 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -613,8 +613,10 @@ bool LiveIntervals::isReMaterializable(const LiveInterval &li, return false; isLoad = false; - if (tii_->isTriviallyReMaterializable(MI)) { - isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG; + const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); + if ((TID->Flags & M_IMPLICIT_DEF_FLAG) || + tii_->isTriviallyReMaterializable(MI)) { + isLoad = TID->Flags & M_LOAD_FLAG; return true; } @@ -677,6 +679,15 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI, bool isSS, int Slot, unsigned Reg) { unsigned MRInfo = 0; const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); + // If it is an implicit def instruction, just delete it. + if (TID->Flags & M_IMPLICIT_DEF_FLAG) { + RemoveMachineInstrFromMaps(MI); + vrm.RemoveMachineInstrFromMaps(MI); + MI->eraseFromParent(); + ++numFolds; + return true; + } + SmallVector<unsigned, 2> FoldOps; for (unsigned i = 0, e = Ops.size(); i != e; ++i) { unsigned OpIdx = Ops[i]; @@ -852,7 +863,8 @@ rewriteInstructionForSpills(const LiveInterval &li, bool TrySplit, } else { CanFold = canFoldMemoryOperand(MI, Ops); } - } else CanFold = false; + } else + CanFold = false; // Create a new virtual register for the spill interval. bool CreatedNewVReg = false; |