aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java
diff options
context:
space:
mode:
authorMads Ager <ager@google.com>2017-06-21 14:57:07 +0200
committerMads Ager <ager@google.com>2017-06-21 14:57:07 +0200
commitda3f62b47221d5251d67920dcc61b8a7b90794da (patch)
tree75a402517e04749a54cb903cb97c53b9cff8e30e /src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java
parentc3b3ff1f3ef53aa3bb6fbc24b94347baca73d7e2 (diff)
downloadr8-da3f62b47221d5251d67920dcc61b8a7b90794da.tar.gz
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
Diffstat (limited to 'src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java')
-rw-r--r--src/main/java/com/android/tools/r8/ir/regalloc/LiveIntervalsUse.java6
1 files changed, 6 insertions, 0 deletions
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<LiveIntervalsUse> {
private int position;
private int limit;
@@ -41,4 +43,8 @@ public class LiveIntervalsUse implements Comparable<LiveIntervalsUse> {
}
return limit - o.limit;
}
+
+ public boolean hasConstraint() {
+ return limit < U16BIT_MAX;
+ }
}