Revert "Do not record uses of unconstrained arguments in register allocation"

This reverts commit fd244097f679213b58e88cc422afadced3301cbc.

Bug: 77240639

Change-Id: I5ec3e5f9570d99815bc3240b692a8c03a8c3be3f
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 89f9352..87a5f83 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
@@ -2173,22 +2173,7 @@
             if (options.isGeneratingDex()) {
               int inConstraint = instruction.maxInValueRegister();
               LiveIntervals useIntervals = use.getLiveIntervals();
-              // Arguments are always kept in their original, incoming register. For every
-              // unconstrained use of an argument we therefore use its incoming register.
-              // As a result, we do not need to record that the argument is being used at the
-              // current instruction.
-              //
-              // For ranged invoke instructions that use a subset of the arguments in the current
-              // order, registering a use for the arguments at the invoke can cause us to run out of
-              // registers. That is because all arguments are forced back into a chosen register at
-              // all uses. Therefore, if we register a use of an argument where we can actually use
-              // it in the argument register, the register allocator would use two registers for the
-              // argument but in reality only use one.
-              boolean isUnconstrainedArgumentUse =
-                  use.isArgument() && inConstraint == Constants.U16BIT_MAX;
-              if (!isUnconstrainedArgumentUse) {
-                useIntervals.addUse(new LiveIntervalsUse(instruction.getNumber(), inConstraint));
-              }
+              useIntervals.addUse(new LiveIntervalsUse(instruction.getNumber(), inConstraint));
             }
           }
         }
diff --git a/src/test/java/com/android/tools/r8/ir/regalloc/B77240639.java b/src/test/java/com/android/tools/r8/ir/regalloc/B77240639.java
index 28a6fa3..440f4f3 100644
--- a/src/test/java/com/android/tools/r8/ir/regalloc/B77240639.java
+++ b/src/test/java/com/android/tools/r8/ir/regalloc/B77240639.java
@@ -16,6 +16,7 @@
 import org.junit.Test;
 
 public class B77240639 extends TestBase {
+  @Ignore("b/77240639")
   @Test
   public void test() throws Exception {
     AndroidApp app = compileWithD8(readClasses(TestClass.class));