mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-03 18:37:56 +00:00
Fix a memory leak in LiveIntervalAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5a7fb69ac2
commit
1ed9922794
@ -72,8 +72,11 @@ void LiveIntervals::releaseMemory() {
|
|||||||
r2iMap_.clear();
|
r2iMap_.clear();
|
||||||
// Release VNInfo memroy regions after all VNInfo objects are dtor'd.
|
// Release VNInfo memroy regions after all VNInfo objects are dtor'd.
|
||||||
VNInfoAllocator.Reset();
|
VNInfoAllocator.Reset();
|
||||||
for (unsigned i = 0, e = ClonedMIs.size(); i != e; ++i)
|
while (!ClonedMIs.empty()) {
|
||||||
mf_->DeleteMachineInstr(ClonedMIs[i]);
|
MachineInstr *MI = ClonedMIs.back();
|
||||||
|
ClonedMIs.pop_back();
|
||||||
|
mf_->DeleteMachineInstr(MI);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LiveIntervals::computeNumbering() {
|
void LiveIntervals::computeNumbering() {
|
||||||
@ -1586,8 +1589,9 @@ addIntervalsForSpills(const LiveInterval &li,
|
|||||||
// Remember how to remat the def of this val#.
|
// Remember how to remat the def of this val#.
|
||||||
ReMatOrigDefs[VN] = ReMatDefMI;
|
ReMatOrigDefs[VN] = ReMatDefMI;
|
||||||
// Original def may be modified so we have to make a copy here.
|
// Original def may be modified so we have to make a copy here.
|
||||||
// FIXME: This is a memory leak. vrm should delete these!
|
MachineInstr *Clone = mf_->CloneMachineInstr(ReMatDefMI);
|
||||||
ReMatDefs[VN] = mf_->CloneMachineInstr(ReMatDefMI);
|
ClonedMIs.push_back(Clone);
|
||||||
|
ReMatDefs[VN] = Clone;
|
||||||
|
|
||||||
bool CanDelete = true;
|
bool CanDelete = true;
|
||||||
if (VNI->hasPHIKill) {
|
if (VNI->hasPHIKill) {
|
||||||
|
@ -312,16 +312,14 @@ MachineInstr::MachineInstr(MachineBasicBlock *MBB,
|
|||||||
|
|
||||||
/// MachineInstr ctor - Copies MachineInstr arg exactly
|
/// MachineInstr ctor - Copies MachineInstr arg exactly
|
||||||
///
|
///
|
||||||
MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI) {
|
MachineInstr::MachineInstr(MachineFunction &MF, const MachineInstr &MI)
|
||||||
TID = &MI.getDesc();
|
: TID(&MI.getDesc()), NumImplicitOps(0), Parent(0) {
|
||||||
NumImplicitOps = MI.NumImplicitOps;
|
|
||||||
Operands.reserve(MI.getNumOperands());
|
Operands.reserve(MI.getNumOperands());
|
||||||
|
|
||||||
// Add operands
|
// Add operands
|
||||||
for (unsigned i = 0; i != MI.getNumOperands(); ++i) {
|
for (unsigned i = 0; i != MI.getNumOperands(); ++i)
|
||||||
Operands.push_back(MI.getOperand(i));
|
addOperand(MI.getOperand(i));
|
||||||
Operands.back().ParentMI = this;
|
NumImplicitOps = MI.NumImplicitOps;
|
||||||
}
|
|
||||||
|
|
||||||
// Add memory operands.
|
// Add memory operands.
|
||||||
for (alist<MachineMemOperand>::const_iterator i = MI.memoperands_begin(),
|
for (alist<MachineMemOperand>::const_iterator i = MI.memoperands_begin(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user