File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,12 @@ class LiveIntervals {
6565 MachineDominatorTree *DomTree = nullptr ;
6666 std::unique_ptr<LiveIntervalCalc> LICalc;
6767
68+ // Allocator for RegUnitRanges and SubRanges.
6869 BumpPtrAllocator Allocator;
6970
71+ // Allocator for VirtRegIntervals
72+ SpecificBumpPtrAllocator<LiveInterval> LIAllocator;
73+
7074 // / Special pool allocator for VNInfo's (LiveInterval val#).
7175 VNInfo::Allocator VNInfoAllocator;
7276
@@ -173,7 +177,7 @@ class LiveIntervals {
173177 // / Interval removal.
174178 void removeInterval (Register Reg) {
175179 auto &Interval = VirtRegIntervals[Reg];
176- Allocator. Deallocate (Interval);
180+ // FIXME: SpecificBumpPtrAllocator missing deallocate for asan poisoning
177181 Interval = nullptr ;
178182 }
179183
Original file line number Diff line number Diff line change @@ -142,10 +142,6 @@ bool LiveIntervals::invalidate(
142142}
143143
144144void LiveIntervals::clear () {
145- // Free the live intervals themselves.
146- for (unsigned i = 0 , e = VirtRegIntervals.size (); i != e; ++i)
147- Allocator.Deallocate (VirtRegIntervals[Register::index2VirtReg (i)]);
148- VirtRegIntervals.clear ();
149145 RegMaskSlots.clear ();
150146 RegMaskBits.clear ();
151147 RegMaskBlocks.clear ();
@@ -154,6 +150,10 @@ void LiveIntervals::clear() {
154150 Allocator.Deallocate (LR);
155151 RegUnitRanges.clear ();
156152
153+ // Free the live intervals themselves.
154+ LIAllocator.DestroyAll ();
155+ VirtRegIntervals.clear ();
156+
157157 // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd.
158158 VNInfoAllocator.Reset ();
159159}
@@ -222,7 +222,7 @@ LLVM_DUMP_METHOD void LiveIntervals::dump() const { print(dbgs()); }
222222
223223LiveInterval *LiveIntervals::createInterval (Register reg) {
224224 float Weight = reg.isPhysical () ? huge_valf : 0 .0F ;
225- return new (Allocator .Allocate <LiveInterval> ()) LiveInterval (reg, Weight);
225+ return new (LIAllocator .Allocate ()) LiveInterval (reg, Weight);
226226}
227227
228228// / Compute the live interval of a virtual register, based on defs and uses.
You can’t perform that action at this time.
0 commit comments