Revert "Revert "Do not update the type of something we already know.""

This reverts commit 63107a804ce17db9789051e1fe310d99d1dae1cb.

bug:22116987
Change-Id: I49a376a5bd2073a69babe122ec0d26e5d2f82461
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index 6784098..3d6606b 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -151,6 +151,15 @@
   HBoundType* bound_type = nullptr;
 
   HInstruction* obj = instanceOf->InputAt(0);
+  if (obj->GetReferenceTypeInfo().IsExact() && !obj->IsPhi()) {
+    // This method is being called while doing a fixed-point calculation
+    // over phis. Non-phis instruction whose type is already known do
+    // not need to be bound to another type.
+    // Not that this also prevents replacing `HLoadClass` with a `HBoundType`.
+    // `HCheckCast` and `HInstanceOf` expect a `HLoadClass` as a second
+    // input.
+    return;
+  }
   for (HUseIterator<HInstruction*> it(obj->GetUses()); !it.Done(); it.Advance()) {
     HInstruction* user = it.Current()->GetUser();
     if (instanceOfTrueBlock->Dominates(user->GetBlock())) {