From 8cbab3c4de3328b576454ce702d7748f56c44346 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 23 Apr 2015 15:14:36 +0100 Subject: Linear scan: split at better positions. - Split at block entry to piggy back on control flow resolution. - Split at the loop header, if the split position is within a loop. Change-Id: I718299a58c02ee02a1b22bda589607c69a35f0e8 --- compiler/optimizing/register_allocator.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/register_allocator.h') diff --git a/compiler/optimizing/register_allocator.h b/compiler/optimizing/register_allocator.h index 717be75533..dc9c708eea 100644 --- a/compiler/optimizing/register_allocator.h +++ b/compiler/optimizing/register_allocator.h @@ -86,8 +86,12 @@ class RegisterAllocator { // Add `interval` in the given sorted list. static void AddSorted(GrowableArray* array, LiveInterval* interval); - // Split `interval` at the position `at`. The new interval starts at `at`. - LiveInterval* Split(LiveInterval* interval, size_t at); + // Split `interval` at the position `position`. The new interval starts at `position`. + LiveInterval* Split(LiveInterval* interval, size_t position); + + // Split `interval` at a position between `from` and `to`. The method will try + // to find an optimal split position. + LiveInterval* SplitBetween(LiveInterval* interval, size_t from, size_t to); // Returns whether `reg` is blocked by the code generator. bool IsBlocked(int reg) const; -- cgit v1.2.3