aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2021-02-22 03:23:48 +0100
committerGitHub <noreply@github.com>2021-02-22 03:23:48 +0100
commitdc0adb533dc15a007e9ca2dc0533ef6a61f13393 (patch)
tree4b3588600cfd163e9f7a72b176b15befe078e941 /ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
parent15868801148129802173f2162ebff24835cb20ba (diff)
PPTC & Pool Enhancements. (#1968)
* PPTC & Pool Enhancements. * Avoid buffer allocations in CodeGenContext.GetCode(). Avoid stream allocations in PTC.PtcInfo. Refactoring/nits. * Use XXHash128, for Ptc.Load & Ptc.Save, x10 faster than Md5. * Why not a nice Span. * Added a simple PtcFormatter library for deserialization/serialization, which does not require reflection, in use at PtcJumpTable and PtcProfiler; improves maintainability and simplicity/readability of affected code. * Nits. * Revert #1987. * Revert "Revert #1987." This reverts commit 998be765cf7f7da5ff0c1c08de704c9012b0f49c.
Diffstat (limited to 'ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs')
-rw-r--r--ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs15
1 files changed, 5 insertions, 10 deletions
diff --git a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
index 71739d43..cd36bdc0 100644
--- a/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
+++ b/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs
@@ -50,6 +50,8 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
StackAlloc = stackAlloc;
Masks = masks;
+ BitMapPool.PrepareBitMapPool();
+
Active = BitMapPool.Allocate(intervalsCount);
Inactive = BitMapPool.Allocate(intervalsCount);
}
@@ -73,7 +75,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
public void Dispose()
{
- BitMapPool.Release();
+ BitMapPool.ResetBitMapPool();
}
}
@@ -84,7 +86,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
{
NumberLocals(cfg);
- AllocationContext context = new AllocationContext(stackAlloc, regMasks, _intervals.Count);
+ using AllocationContext context = new AllocationContext(stackAlloc, regMasks, _intervals.Count);
BuildIntervals(cfg, context);
@@ -127,14 +129,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
InsertSplitCopies();
InsertSplitCopiesAtEdges(cfg);
- AllocationResult result = new AllocationResult(
- context.IntUsedRegisters,
- context.VecUsedRegisters,
- context.StackAlloc.TotalSize);
-
- context.Dispose();
-
- return result;
+ return new AllocationResult(context.IntUsedRegisters, context.VecUsedRegisters, context.StackAlloc.TotalSize);
}
private void AllocateInterval(AllocationContext context, LiveInterval current, int cIndex)