Use ArtMethod::GetImtIndex to avoid recomputing the imt index.

Small inefficiency spotted when investigating b/249522283.

Test: test.py
Bug: 249522283
Change-Id: I96f7a141b2e3ad6669760e2f784a093ce58c277f
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index ba58c8d..b80e509 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -981,7 +981,8 @@
     *imt_or_vtable_index = resolved_method->GetVtableIndex();
   } else if (*invoke_type == kInterface) {
     // For HInvokeInterface we need the IMT index.
-    *imt_or_vtable_index = ImTable::GetImtIndex(resolved_method);
+    *imt_or_vtable_index = resolved_method->GetImtIndex();
+    DCHECK_EQ(*imt_or_vtable_index, ImTable::GetImtIndex(resolved_method));
   }
 
   *is_string_constructor =