Handle predicated-gets with default values
Due to an oversight the default-value of a PredicatedGet did not
support being a Default value. This fixes that oversight.
Test: ./art/tools/compile-jar.py --profile-line 'HSLe/k/a/g/i;->i(Le/k/a/g/d;Ljava/io/OutputStream;)V' --arch arm64 ~/no.nrk.mobil.radio_10922_base_split.apk --compiler-filter=speed-profile --dump-stats -j1 --force-allow-oj-inlines
Test: LoadStoreEliminationTest.PredicatedLoadDefaultValue
Bug: 183898383
Change-Id: I11bccddb0b5a5c2e958690864ff2d4449a9f2fad
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index b1ec62a..1ea2ece 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -3613,9 +3613,13 @@
HInstruction* res = Replacement(pred).GetInstruction();
LSE_VLOG << pred << " materialized to " << res->DumpWithArgs();
return res;
+ } else if (pred.IsDefault()) {
+ HInstruction* res = GetDefaultValue(read->GetType());
+ LSE_VLOG << pred << " materialized to " << res->DumpWithArgs();
+ return res;
}
LOG(FATAL) << "Unable to find unescaped value at " << read->DumpWithArgs()
- << "! This should be impossible!";
+ << "! This should be impossible! Value is " << pred;
UNREACHABLE();
}