From da3f62b47221d5251d67920dcc61b8a7b90794da Mon Sep 17 00:00:00 2001 From: Mads Ager Date: Wed, 21 Jun 2017 14:57:07 +0200 Subject: Change register allocator to deal better with unconstrained uses. When low on registers, if the interval we are currently attempting to allocate a register for has an unconstrained first use, split the current interval instead of finding another interval to split. In addition, make the determination of when to split argument values right after their definition more precise. These changes shouldn't matter much at this point. However, zerny@ is working on changes to debug information handling that will make this occur a lot more for arguments. For such cases this is needed and generates better code than we currently do. R=zerny@google.com Change-Id: I6d83b91a15486d294c2c66f68b17cb871c0cbae1 --- .../java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java') diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java index fd37af8f3..a60213453 100644 --- a/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java +++ b/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java @@ -3,6 +3,8 @@ // BSD-style license that can be found in the LICENSE file. package com.android.tools.r8.ir.regalloc; +import static com.android.tools.r8.dex.Constants.U16BIT_MAX; + public class LiveIntervalsUse implements Comparable { private int position; private int limit; @@ -41,4 +43,8 @@ public class LiveIntervalsUse implements Comparable { } return limit - o.limit; } + + public boolean hasConstraint() { + return limit < U16BIT_MAX; + } } -- cgit v1.2.3