Enable LSE of shadow-klass field

The Object.shadow$_klass_ field is special in that it has a non-null
default value. Previously, however, LSE would always treat it as
having an Unknown value. This meant LSE was unable to handle reads
from the shadow$_klass_ field and replace it with the associated
LoadClass, leading to some allocations not being eliminated.

This change correctly informs LSE that the value should initially be
the LoadClass instruction.

Test: ./test.py --host
Bug: 67037140

Change-Id: I9099001211c6c099a5d1ab4188e2b11f79e2ad9e
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index 0110134..590328f 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -944,10 +944,16 @@
       HInstruction* ref =
           heap_location_collector_.GetHeapLocation(i)->GetReferenceInfo()->GetReference();
       size_t offset = heap_location_collector_.GetHeapLocation(i)->GetOffset();
-      if (ref == new_instance && offset >= mirror::kObjectHeaderSize) {
-        // Instance fields except the header fields are set to default heap values.
-        heap_values[i].value = Value::Default();
-        heap_values[i].stored_by = Value::Unknown();
+      if (ref == new_instance) {
+        if (offset >= mirror::kObjectHeaderSize) {
+          // Instance fields except the header fields are set to default heap values.
+          heap_values[i].value = Value::Default();
+          heap_values[i].stored_by = Value::Unknown();
+        } else if (MemberOffset(offset) == mirror::Object::ClassOffset()) {
+          // The shadow$_klass_ field is special and has an actual value however.
+          heap_values[i].value = Value::ForInstruction(new_instance->GetLoadClass());
+          heap_values[i].stored_by = Value::Unknown();
+        }
       }
     }
   }