commit | 1a658189968d535db3a45f72caa3c525fe9cf149 | [log] [tgz] |
---|---|---|
author | Christoffer Quist Adamsen <christofferqa@google.com> | Mon Aug 30 08:13:22 2021 +0200 |
committer | Christoffer Quist Adamsen <christofferqa@google.com> | Mon Aug 30 08:13:22 2021 +0200 |
tree | 4cb5b93d8b14ef19862cb601668aea0fd04ed86f | |
parent | da2dbcd929ff1521e89f1769917d89dfdaebe0d3 [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 837d5fc..73f0fe5 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
@@ -707,9 +707,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(