Refactor argument and range-invoke set-up prior to register allocation.
This is in preparation for computing two sets of live intervals: one considering
local information and one without.
Change-Id: Ie65d18b27b9cdbc52baa4bd35f388c17c423ba27
diff --git a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java
index d2c7701..a9df6a3 100644
--- a/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java
+++ b/src/main/java/com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.java
@@ -195,7 +195,8 @@
transformBridgeMethod();
}
computeNeedsRegister();
- insertArgumentMoves();
+ constrainArgumentIntervals();
+ insertRangeInvokeMoves();
ImmutableList<BasicBlock> blocks = computeLivenessInformation();
// First attempt to allocate register allowing argument reuse. This will fail if spilling
// is required or if we end up using more than 16 registers.
@@ -2598,11 +2599,14 @@
}
}
- private void insertArgumentMoves() {
+ private void constrainArgumentIntervals() {
// Record the constraint that incoming arguments are in consecutive registers.
List<Value> arguments = code.collectArguments();
createArgumentLiveIntervals(arguments);
linkArgumentValuesAndIntervals(arguments);
+ }
+
+ private void insertRangeInvokeMoves() {
for (BasicBlock block : code.blocks) {
InstructionListIterator it = block.listIterator();
while (it.hasNext()) {