Remove transfers of in-values to debug-values.
All locals are created with explicit end users thus normal in-values
never affect the live range of locals.
Change-Id: Ibec3de3cbc58eeba0ec9baede2b4819a2d30e0f8
diff --git a/src/main/java/com/android/tools/r8/ir/code/BasicBlockInstructionListIterator.java b/src/main/java/com/android/tools/r8/ir/code/BasicBlockInstructionListIterator.java
index 7acb409..363c6a1 100644
--- a/src/main/java/com/android/tools/r8/ir/code/BasicBlockInstructionListIterator.java
+++ b/src/main/java/com/android/tools/r8/ir/code/BasicBlockInstructionListIterator.java
@@ -243,12 +243,6 @@
// Replace the instruction by const-number.
ConstNumber constNumber = code.createIntConstant(value, current.getLocalInfo());
- for (Value inValue : current.inValues()) {
- if (inValue.hasLocalInfo()) {
- // Add this value as a debug value to avoid changing its live range.
- constNumber.addDebugValue(inValue);
- }
- }
replaceCurrentInstruction(constNumber);
}
@@ -264,12 +258,6 @@
TypeElement oldType = current.getOutType();
Value value = code.createValue(newType, current.getLocalInfo());
StaticGet staticGet = new StaticGet(value, field);
- for (Value inValue : current.inValues()) {
- if (inValue.hasLocalInfo()) {
- // Add this value as a debug value to avoid changing its live range.
- staticGet.addDebugValue(inValue);
- }
- }
replaceCurrentInstruction(staticGet);
// Update affected values.
diff --git a/src/main/java/com/android/tools/r8/ir/code/Instruction.java b/src/main/java/com/android/tools/r8/ir/code/Instruction.java
index 1400455..4682ecc 100644
--- a/src/main/java/com/android/tools/r8/ir/code/Instruction.java
+++ b/src/main/java/com/android/tools/r8/ir/code/Instruction.java
@@ -198,8 +198,8 @@
public void replaceDebugValue(Value oldValue, Value newValue) {
if (debugValues.remove(oldValue)) {
- // TODO(mathiasr): Enable this assertion when BasicBlock has current position so trivial phi
- // removal can take local info into account.
+ // TODO(b/157464189): Enable this assertion when BasicBlock has current position so trivial
+ // phi removal can take local info into account.
// assert newValue.getLocalInfo() == oldValue.getLocalInfo()
// : "Replacing debug values with inconsistent locals " +
// oldValue.getLocalInfo() + " and " + newValue.getLocalInfo() +
diff --git a/src/main/java/com/android/tools/r8/ir/code/Value.java b/src/main/java/com/android/tools/r8/ir/code/Value.java
index 53af0fc..f49c1e3 100644
--- a/src/main/java/com/android/tools/r8/ir/code/Value.java
+++ b/src/main/java/com/android/tools/r8/ir/code/Value.java
@@ -163,6 +163,8 @@
// A debug-value user represents a point where the value is live, ends or starts.
// If a point is marked as both ending and starting then it is simply live, but we maintain
// the marker so as not to unintentionally end it if marked again.
+ // TODO(b/157466079): Clean/remove the use markers. With the current local construction in the
+ // IRBuilder, the only needed markers should be 'end' markers.
private enum DebugUse {
LIVE, START, END, LIVE_FINAL;