commit | d768ea7cee7400cbcd9afaf638ee09e73bbc4266 | [log] [tgz] |
---|---|---|
author | Christoffer Quist Adamsen <christofferqa@google.com> | Mon Aug 30 09:07:30 2021 +0200 |
committer | Christoffer Quist Adamsen <christofferqa@google.com> | Mon Aug 30 09:07:30 2021 +0200 |
tree | bcd48ca8a00f4b2f51f4f5178d83a609a1e5f37e | |
parent | aa0e49da8fa42138d53f42c3b4530edd46893345 [diff] |
Handle trivial phis in constant null to constant zero rewriting Bug: 197754200 Change-Id: Idd03e59f681010dd64a6a922241a2041bcc77559
diff --git a/src/main/java/com/android/tools/r8/ir/conversion/LensCodeRewriter.java b/src/main/java/com/android/tools/r8/ir/conversion/LensCodeRewriter.java index b02d5e7..cd298e0 100644 --- a/src/main/java/com/android/tools/r8/ir/conversion/LensCodeRewriter.java +++ b/src/main/java/com/android/tools/r8/ir/conversion/LensCodeRewriter.java
@@ -700,9 +700,8 @@ DexType oldType, DexType newType, Value initialValue) { - if (initialValue.isConstNumber() - && initialValue.definition.asConstNumber().isZero() - && defaultValueHasChanged(oldType, newType)) { + if (initialValue.getType().isNullType() && defaultValueHasChanged(oldType, newType)) { + assert newType.isIntType(); iterator.previous(); Value rewrittenDefaultValue = iterator.insertConstNumberInstruction(