ART: Extend the range of clonable instructions.

Make a bunch of instructions clonable: DivZeroCheck,
TypeConversion, InstanceOf, CheckCast.

Test: with forced peeling and unrolling (applied to every clonable
loop) all the test pass and device boots to GUI.

Test: angler boots to GUI.
Test: test-art-target, test-art-host.
Test: 530-checker-peel-unroll.

Change-Id: Id056b998e0a656dbada6958e7c667b7331047059
diff --git a/compiler/optimizing/loop_analysis.h b/compiler/optimizing/loop_analysis.h
index c09d3ff..7f321b7 100644
--- a/compiler/optimizing/loop_analysis.h
+++ b/compiler/optimizing/loop_analysis.h
@@ -113,9 +113,7 @@
         instruction->IsUnresolvedStaticFieldGet() ||
         instruction->IsUnresolvedStaticFieldSet() ||
         // TODO: Support loops with intrinsified invokes.
-        instruction->IsInvoke() ||
-        // TODO: Support loops with ClinitChecks.
-        instruction->IsClinitCheck());
+        instruction->IsInvoke());
   }
 };
 
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 975ad1c..8257799 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -5155,6 +5155,7 @@
     SetRawInputAt(0, value);
   }
 
+  bool IsClonable() const OVERRIDE { return true; }
   bool CanBeMoved() const OVERRIDE { return true; }
 
   bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const OVERRIDE {
@@ -5606,6 +5607,7 @@
   DataType::Type GetInputType() const { return GetInput()->GetType(); }
   DataType::Type GetResultType() const { return GetType(); }
 
+  bool IsClonable() const OVERRIDE { return true; }
   bool CanBeMoved() const OVERRIDE { return true; }
   bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const OVERRIDE {
     return true;
@@ -6641,8 +6643,7 @@
             dex_pc) {
     SetRawInputAt(0, constant);
   }
-
-  bool IsClonable() const OVERRIDE { return true; }
+  // TODO: Make ClinitCheck clonable.
   bool CanBeMoved() const OVERRIDE { return true; }
   bool InstructionDataEquals(const HInstruction* other ATTRIBUTE_UNUSED) const OVERRIDE {
     return true;
@@ -7112,6 +7113,8 @@
                               bitstring_mask,
                               SideEffectsForArchRuntimeCalls(check_kind)) {}
 
+  bool IsClonable() const OVERRIDE { return true; }
+
   bool NeedsEnvironment() const OVERRIDE {
     return CanCallRuntime(GetTypeCheckKind());
   }
@@ -7201,6 +7204,7 @@
                               bitstring_mask,
                               SideEffects::CanTriggerGC()) {}
 
+  bool IsClonable() const OVERRIDE { return true; }
   bool NeedsEnvironment() const OVERRIDE {
     // Instruction may throw a CheckCastError.
     return true;