Просмотр исходного кода

Don't create instructions for implicit constants. (#4497)

When an instruction is created as part of an implicit call to an
interface member, we generated a bunch of constants for naming the
interface, finding the corresponding specific, accessing its member
function, and so on. This led to significant bloat in SemIR.

Instead, we now track whether an instruction is created implicitly in
its location, and where relevant, we use the constant value of the
instruction directly instead of storing a new `Inst`.

This doesn't reduce the amount of work we need to do, but does make the
representation in SemIR smaller and more readable.
Richard Smith 1 год назад
Родитель
Сommit
fcabeb6725
79 измененных файлов с 249 добавлено и 513 удалено
  1. 12 12
      toolchain/check/call.cpp
  2. 14 0
      toolchain/check/context.cpp
  3. 11 0
      toolchain/check/context.h
  4. 10 10
      toolchain/check/member_access.cpp
  5. 2 2
      toolchain/check/operator.cpp
  6. 1 4
      toolchain/check/testdata/array/fail_bound_overflow.carbon
  7. 1 4
      toolchain/check/testdata/array/fail_invalid_type.carbon
  8. 2 8
      toolchain/check/testdata/array/fail_type_mismatch.carbon
  9. 1 4
      toolchain/check/testdata/as/adapter_conversion.carbon
  10. 2 5
      toolchain/check/testdata/as/fail_no_conversion.carbon
  11. 1 4
      toolchain/check/testdata/as/fail_not_type.carbon
  12. 13 19
      toolchain/check/testdata/as/overloaded.carbon
  13. 1 4
      toolchain/check/testdata/basics/fail_non_type_as_type.carbon
  14. 3 9
      toolchain/check/testdata/class/extend_adapt.carbon
  15. 2 8
      toolchain/check/testdata/class/fail_adapt_bad_decl.carbon
  16. 5 20
      toolchain/check/testdata/class/fail_base_bad_type.carbon
  17. 2 5
      toolchain/check/testdata/class/fail_compound_type_mismatch.carbon
  18. 2 8
      toolchain/check/testdata/class/fail_derived_to_base.carbon
  19. 1 4
      toolchain/check/testdata/class/fail_self.carbon
  20. 1 4
      toolchain/check/testdata/class/generic/call.carbon
  21. 1 4
      toolchain/check/testdata/class/generic/import.carbon
  22. 1 13
      toolchain/check/testdata/class/generic/member_access.carbon
  23. 4 16
      toolchain/check/testdata/class/init_adapt.carbon
  24. 1 4
      toolchain/check/testdata/class/self.carbon
  25. 1 4
      toolchain/check/testdata/const/fail_collapse.carbon
  26. 1 4
      toolchain/check/testdata/deduce/array.carbon
  27. 0 2
      toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon
  28. 1 4
      toolchain/check/testdata/function/call/fail_param_type.carbon
  29. 1 4
      toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon
  30. 1 4
      toolchain/check/testdata/function/generic/resolve_used.carbon
  31. 1 4
      toolchain/check/testdata/impl/fail_impl_bad_interface.carbon
  32. 3 6
      toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon
  33. 1 4
      toolchain/check/testdata/index/fail_array_non_int_indexing.carbon
  34. 0 1
      toolchain/check/testdata/index/fail_negative_indexing.carbon
  35. 3 6
      toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon
  36. 1 4
      toolchain/check/testdata/let/compile_time_bindings.carbon
  37. 2 8
      toolchain/check/testdata/let/fail_generic.carbon
  38. 2 5
      toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon
  39. 1 4
      toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon
  40. 0 2
      toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon
  41. 0 1
      toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon
  42. 0 2
      toolchain/check/testdata/operators/overloaded/add.carbon
  43. 0 2
      toolchain/check/testdata/operators/overloaded/bit_and.carbon
  44. 0 1
      toolchain/check/testdata/operators/overloaded/bit_complement.carbon
  45. 0 2
      toolchain/check/testdata/operators/overloaded/bit_or.carbon
  46. 0 2
      toolchain/check/testdata/operators/overloaded/bit_xor.carbon
  47. 0 1
      toolchain/check/testdata/operators/overloaded/dec.carbon
  48. 0 2
      toolchain/check/testdata/operators/overloaded/div.carbon
  49. 1 10
      toolchain/check/testdata/operators/overloaded/eq.carbon
  50. 0 2
      toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon
  51. 2 6
      toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon
  52. 2 10
      toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon
  53. 19 25
      toolchain/check/testdata/operators/overloaded/implicit_as.carbon
  54. 0 1
      toolchain/check/testdata/operators/overloaded/inc.carbon
  55. 18 30
      toolchain/check/testdata/operators/overloaded/index.carbon
  56. 0 2
      toolchain/check/testdata/operators/overloaded/left_shift.carbon
  57. 0 2
      toolchain/check/testdata/operators/overloaded/mod.carbon
  58. 0 2
      toolchain/check/testdata/operators/overloaded/mul.carbon
  59. 0 1
      toolchain/check/testdata/operators/overloaded/negate.carbon
  60. 3 6
      toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon
  61. 0 8
      toolchain/check/testdata/operators/overloaded/ordered.carbon
  62. 0 2
      toolchain/check/testdata/operators/overloaded/right_shift.carbon
  63. 0 2
      toolchain/check/testdata/operators/overloaded/sub.carbon
  64. 1 4
      toolchain/check/testdata/pointer/fail_type_mismatch.carbon
  65. 1 4
      toolchain/check/testdata/return/fail_type_mismatch.carbon
  66. 48 72
      toolchain/check/testdata/return/no_prelude/import_convert_function.carbon
  67. 1 4
      toolchain/check/testdata/struct/fail_type_assign.carbon
  68. 2 5
      toolchain/check/testdata/struct/fail_value_as_type.carbon
  69. 1 4
      toolchain/check/testdata/struct/import.carbon
  70. 0 1
      toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon
  71. 1 4
      toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon
  72. 1 4
      toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon
  73. 1 4
      toolchain/check/testdata/tuple/fail_type_assign.carbon
  74. 1 4
      toolchain/check/testdata/tuple/fail_value_as_type.carbon
  75. 1 4
      toolchain/check/testdata/tuple/import.carbon
  76. 1 4
      toolchain/check/testdata/var/fail_storage_is_literal.carbon
  77. 8 29
      toolchain/check/testdata/where_expr/constraints.carbon
  78. 1 4
      toolchain/check/testdata/while/fail_bad_condition.carbon
  79. 22 3
      toolchain/sem_ir/ids.h

+ 12 - 12
toolchain/check/call.cpp

@@ -97,7 +97,7 @@ static auto PerformCallToGenericClass(Context& context, SemIR::LocId loc_id,
   if (!callee_specific_id) {
     return SemIR::InstId::BuiltinError;
   }
-  return context.AddInst<SemIR::ClassType>(
+  return context.GetOrAddInst<SemIR::ClassType>(
       loc_id, {.type_id = SemIR::TypeId::TypeType,
                .class_id = class_id,
                .specific_id = *callee_specific_id});
@@ -117,7 +117,7 @@ static auto PerformCallToGenericInterface(
   if (!callee_specific_id) {
     return SemIR::InstId::BuiltinError;
   }
-  return context.AddInst<SemIR::InterfaceType>(
+  return context.GetOrAddInst<SemIR::InterfaceType>(
       loc_id, {.type_id = SemIR::TypeId::TypeType,
                .interface_id = interface_id,
                .specific_id = *callee_specific_id});
@@ -162,13 +162,13 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id,
     return SemIR::InstId::BuiltinError;
   }
   if (callee_specific_id->is_valid()) {
-    callee_id =
-        context.AddInst(context.insts().GetLocId(callee_id),
-                        SemIR::SpecificFunction{
-                            .type_id = context.GetBuiltinType(
-                                SemIR::BuiltinInstKind::SpecificFunctionType),
-                            .callee_id = callee_id,
-                            .specific_id = *callee_specific_id});
+    callee_id = context.GetOrAddInst(
+        context.insts().GetLocId(callee_id),
+        SemIR::SpecificFunction{
+            .type_id = context.GetBuiltinType(
+                SemIR::BuiltinInstKind::SpecificFunctionType),
+            .callee_id = callee_id,
+            .specific_id = *callee_specific_id});
     context.definitions_required().push_back(callee_id);
   }
 
@@ -212,9 +212,9 @@ auto PerformCall(Context& context, SemIR::LocId loc_id, SemIR::InstId callee_id,
       ConvertCallArgs(context, loc_id, callee_function.self_id, arg_ids,
                       return_slot_arg_id, function, *callee_specific_id);
   auto call_inst_id =
-      context.AddInst<SemIR::Call>(loc_id, {.type_id = return_info.type_id,
-                                            .callee_id = callee_id,
-                                            .args_id = converted_args_id});
+      context.GetOrAddInst<SemIR::Call>(loc_id, {.type_id = return_info.type_id,
+                                                 .callee_id = callee_id,
+                                                 .args_id = converted_args_id});
 
   return call_inst_id;
 }

+ 14 - 0
toolchain/check/context.cpp

@@ -88,6 +88,20 @@ auto Context::VerifyOnFinish() -> void {
   param_and_arg_refs_stack_.VerifyOnFinish();
 }
 
+auto Context::GetOrAddInst(SemIR::LocIdAndInst loc_id_and_inst)
+    -> SemIR::InstId {
+  if (loc_id_and_inst.loc_id.is_implicit()) {
+    auto const_id =
+        TryEvalInst(*this, SemIR::InstId::Invalid, loc_id_and_inst.inst);
+    if (const_id.is_valid()) {
+      CARBON_VLOG("GetOrAddInst: constant: {0}\n", loc_id_and_inst.inst);
+      return constant_values().GetInstId(const_id);
+    }
+  }
+  // TODO: For an implicit instruction, this reattempts evaluation.
+  return AddInst(loc_id_and_inst);
+}
+
 // Finish producing an instruction. Set its constant value, and register it in
 // any applicable instruction lists.
 auto Context::FinishInst(SemIR::InstId inst_id, SemIR::Inst inst) -> void {

+ 11 - 0
toolchain/check/context.h

@@ -124,6 +124,17 @@ class Context {
     return AddInstInNoBlock(SemIR::LocIdAndInst(loc, inst));
   }
 
+  // If the instruction has an implicit location and a constant value, returns
+  // the constant value's instruction ID. Otherwise, same as AddInst.
+  auto GetOrAddInst(SemIR::LocIdAndInst loc_id_and_inst) -> SemIR::InstId;
+
+  // Convenience for GetOrAddInst with typed nodes.
+  template <typename InstT, typename LocT>
+  auto GetOrAddInst(LocT loc, InstT inst)
+      -> decltype(GetOrAddInst(SemIR::LocIdAndInst(loc, inst))) {
+    return GetOrAddInst(SemIR::LocIdAndInst(loc, inst));
+  }
+
   // Adds an instruction to the current block, returning the produced ID. The
   // instruction is a placeholder that is expected to be replaced by
   // `ReplaceInstBeforeConstantUse`.

+ 10 - 10
toolchain/check/member_access.cpp

@@ -226,7 +226,7 @@ static auto PerformImplLookup(
   auto subst_type_id = SemIR::GetTypeInSpecific(
       context.sem_ir(), interface_type.specific_id, assoc_type.entity_type_id);
 
-  return context.AddInst<SemIR::InterfaceWitnessAccess>(
+  return context.GetOrAddInst<SemIR::InterfaceWitnessAccess>(
       loc_id, {.type_id = subst_type_id,
                .witness_id = witness_id,
                .index = assoc_entity->index});
@@ -267,7 +267,7 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id,
   // store the specific too.
   if (result.specific_id.is_valid() &&
       context.constant_values().Get(result.inst_id).is_symbolic()) {
-    result.inst_id = context.AddInst<SemIR::SpecificConstant>(
+    result.inst_id = context.GetOrAddInst<SemIR::SpecificConstant>(
         loc_id, {.type_id = type_id,
                  .inst_id = result.inst_id,
                  .specific_id = result.specific_id});
@@ -275,7 +275,7 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id,
 
   // TODO: Use a different kind of instruction that also references the
   // `base_id` so that `SemIR` consumers can find it.
-  auto member_id = context.AddInst<SemIR::NameRef>(
+  auto member_id = context.GetOrAddInst<SemIR::NameRef>(
       loc_id,
       {.type_id = type_id, .name_id = name_id, .value_id = result.inst_id});
 
@@ -316,7 +316,7 @@ static auto PerformInstanceBinding(Context& context, SemIR::LocId loc_id,
                    "Non-constant value {0} of unbound element type",
                    context.insts().Get(member_id));
       auto index = GetClassElementIndex(context, element_id);
-      auto access_id = context.AddInst<SemIR::ClassElementAccess>(
+      auto access_id = context.GetOrAddInst<SemIR::ClassElementAccess>(
           loc_id, {.type_id = unbound_element_type.element_type_id,
                    .base_id = base_id,
                    .index = index});
@@ -335,7 +335,7 @@ static auto PerformInstanceBinding(Context& context, SemIR::LocId loc_id,
     }
     case CARBON_KIND(SemIR::FunctionType fn_type): {
       if (IsInstanceMethod(context.sem_ir(), fn_type.function_id)) {
-        return context.AddInst<SemIR::BoundMethod>(
+        return context.GetOrAddInst<SemIR::BoundMethod>(
             loc_id, {.type_id = context.GetBuiltinType(
                          SemIR::BuiltinInstKind::BoundMethodType),
                      .object_id = base_id,
@@ -411,7 +411,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id,
         if (name_id == field.name_id) {
           // TODO: Model this as producing a lookup result, and do instance
           // binding separately. Perhaps a struct type should be a name scope.
-          return context.AddInst<SemIR::StructAccess>(
+          return context.GetOrAddInst<SemIR::StructAccess>(
               loc_id, {.type_id = field.field_type_id,
                        .struct_id = base_id,
                        .index = SemIR::ElementIndex(i)});
@@ -530,10 +530,10 @@ auto PerformTupleAccess(Context& context, SemIR::LocId loc_id,
   element_type_id = type_block[index_val->getZExtValue()];
   auto tuple_index = SemIR::ElementIndex(index_val->getZExtValue());
 
-  return context.AddInst<SemIR::TupleAccess>(loc_id,
-                                             {.type_id = element_type_id,
-                                              .tuple_id = tuple_inst_id,
-                                              .index = tuple_index});
+  return context.GetOrAddInst<SemIR::TupleAccess>(loc_id,
+                                                  {.type_id = element_type_id,
+                                                   .tuple_id = tuple_inst_id,
+                                                   .index = tuple_index});
 }
 
 }  // namespace Carbon::Check

+ 2 - 2
toolchain/check/operator.cpp

@@ -34,7 +34,7 @@ auto BuildUnaryOperator(Context& context, SemIR::LocId loc_id, Operator op,
                         Context::BuildDiagnosticFn missing_impl_diagnoser)
     -> SemIR::InstId {
   // Look up the operator function.
-  auto op_fn = GetOperatorOpFunction(context, loc_id, op);
+  auto op_fn = GetOperatorOpFunction(context, loc_id.ToImplicit(), op);
 
   // Form `operand.(Op)`.
   auto bound_op_id = PerformCompoundMemberAccess(context, loc_id, operand_id,
@@ -52,7 +52,7 @@ auto BuildBinaryOperator(Context& context, SemIR::LocId loc_id, Operator op,
                          Context::BuildDiagnosticFn missing_impl_diagnoser)
     -> SemIR::InstId {
   // Look up the operator function.
-  auto op_fn = GetOperatorOpFunction(context, loc_id, op);
+  auto op_fn = GetOperatorOpFunction(context, loc_id.ToImplicit(), op);
 
   // Form `lhs.(Op)`.
   auto bound_op_id = PerformCompoundMemberAccess(context, loc_id, lhs_id, op_fn,

+ 1 - 4
toolchain/check/testdata/array/fail_bound_overflow.carbon

@@ -85,10 +85,7 @@ var b: [1; 39999999999999999993];
 // CHECK:STDOUT:   %a.var: ref <error> = var a
 // CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var
 // CHECK:STDOUT:   %.loc30_9.1: i32 = int_value 1 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc30_9.2: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc30_9.2 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc30_9.3: type = converted %.loc30_9.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc30_9.2: type = converted %.loc30_9.1, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc30_32: type = array_type <error>, <error> [template = <error>]
 // CHECK:STDOUT:   %b.var: ref <error> = var b
 // CHECK:STDOUT:   %b: ref <error> = bind_name b, %b.var

+ 1 - 4
toolchain/check/testdata/array/fail_invalid_type.carbon

@@ -62,10 +62,7 @@ var a: [1; 1];
 // CHECK:STDOUT:   %Core.import = import Core
 // CHECK:STDOUT:   %.loc17_9.1: i32 = int_value 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc17_12: i32 = int_value 1 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_9.2: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc17_9.2 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc17_9.3: type = converted %.loc17_9.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_9.2: type = converted %.loc17_9.1, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc17_13: type = array_type %.loc17_12, <error> [template = <error>]
 // CHECK:STDOUT:   %a.var: ref <error> = var a
 // CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var

+ 2 - 8
toolchain/check/testdata/array/fail_type_mismatch.carbon

@@ -193,10 +193,7 @@ var d: [i32; 3] = t2;
 // CHECK:STDOUT:   %.loc18_39.2: i32 = int_value 0 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc18_39.3: ref i32 = array_index file.%a.var, %.loc18_39.2
 // CHECK:STDOUT:   %.loc18_39.4: init i32 = initialize_from %.loc18_20 to %.loc18_39.3 [template = constants.%.5]
-// CHECK:STDOUT:   %ImplicitAs.type.loc18: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_39.5: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref.loc18: %.13 = name_ref Convert, %.loc18_39.5 [template = constants.%.14]
-// CHECK:STDOUT:   %.loc18_39.6: i32 = converted %.loc18_23, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_39.5: i32 = converted %.loc18_23, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%a.var, <error>
 // CHECK:STDOUT:   %t1.ref: ref %.9 = name_ref t1, file.%t1
 // CHECK:STDOUT:   %.loc28_19.1: ref i32 = tuple_access %t1.ref, element0
@@ -205,10 +202,7 @@ var d: [i32; 3] = t2;
 // CHECK:STDOUT:   %.loc28_19.4: ref i32 = array_index file.%b.var, %.loc28_19.3
 // CHECK:STDOUT:   %.loc28_19.5: init i32 = initialize_from %.loc28_19.2 to %.loc28_19.4
 // CHECK:STDOUT:   %.loc28_19.6: ref String = tuple_access %t1.ref, element1
-// CHECK:STDOUT:   %ImplicitAs.type.loc28: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc28_19.7: %.13 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref.loc28: %.13 = name_ref Convert, %.loc28_19.7 [template = constants.%.14]
-// CHECK:STDOUT:   %.loc28_19.8: i32 = converted %.loc28_19.6, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc28_19.7: i32 = converted %.loc28_19.6, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%b.var, <error>
 // CHECK:STDOUT:   %.loc34_20: i32 = int_value 1 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc34_23: i32 = int_value 2 [template = constants.%.19]

+ 1 - 4
toolchain/check/testdata/as/adapter_conversion.carbon

@@ -631,12 +631,9 @@ var b: B = {.x = 1} as B;
 // CHECK:STDOUT:   %.loc21_18: i32 = int_value 1 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc21_19.1: %.3 = struct_literal (%.loc21_18)
 // CHECK:STDOUT:   %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
-// CHECK:STDOUT:   %As.type: type = interface_type @As, @As(constants.%B) [template = constants.%As.type.3]
-// CHECK:STDOUT:   %.loc21_21.1: %.10 = specific_constant imports.%import_ref.4, @As(constants.%B) [template = constants.%.11]
-// CHECK:STDOUT:   %Convert.ref: %.10 = name_ref Convert, %.loc21_21.1 [template = constants.%.11]
 // CHECK:STDOUT:   %struct: %.3 = struct_value (%.loc21_18) [template = constants.%struct]
 // CHECK:STDOUT:   %.loc21_19.2: %.3 = converted %.loc21_19.1, %struct [template = constants.%struct]
-// CHECK:STDOUT:   %.loc21_21.2: %B = converted %.loc21_19.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_21: %B = converted %.loc21_19.1, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%b.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 5
toolchain/check/testdata/as/fail_no_conversion.carbon

@@ -118,11 +118,8 @@ let n: (i32, i32) = 1 as (i32, i32);
 // CHECK:STDOUT:   %.loc17_35.4: type = value_of_initializer %int.make_type_32.loc17_32 [template = i32]
 // CHECK:STDOUT:   %.loc17_35.5: type = converted %int.make_type_32.loc17_32, %.loc17_35.4 [template = i32]
 // CHECK:STDOUT:   %.loc17_35.6: type = converted %.loc17_35.1, constants.%.3 [template = constants.%.3]
-// CHECK:STDOUT:   %As.type: type = interface_type @As, @As(constants.%.3) [template = constants.%As.type.3]
-// CHECK:STDOUT:   %.loc17_23.1: %.8 = specific_constant imports.%import_ref.4, @As(constants.%.3) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref: %.8 = name_ref Convert, %.loc17_23.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc17_23.2: %.3 = converted %.loc17_21, <error> [template = <error>]
-// CHECK:STDOUT:   %.loc17_23.3: i32 = tuple_access %.loc17_23.2, element0 [template = <error>]
+// CHECK:STDOUT:   %.loc17_23.1: %.3 = converted %.loc17_21, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_23.2: i32 = tuple_access %.loc17_23.1, element0 [template = <error>]
 // CHECK:STDOUT:   %n: %.3 = bind_name n, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/as/fail_not_type.carbon

@@ -104,10 +104,7 @@ let n: i32 = 1 as 2;
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc17_14: i32 = int_value 1 [template = constants.%.2]
 // CHECK:STDOUT:   %.loc17_19.1: i32 = int_value 2 [template = constants.%.3]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_19.2: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc17_19.2 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc17_19.3: type = converted %.loc17_19.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_19.2: type = converted %.loc17_19.1, <error> [template = <error>]
 // CHECK:STDOUT:   %n: i32 = bind_name n, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 13 - 19
toolchain/check/testdata/as/overloaded.carbon

@@ -227,28 +227,22 @@ let n: i32 = ((4 as i32) as X) as i32;
 // CHECK:STDOUT:   %.loc23_21.1: type = value_of_initializer %int.make_type_32.loc23_21 [template = i32]
 // CHECK:STDOUT:   %.loc23_21.2: type = converted %int.make_type_32.loc23_21, %.loc23_21.1 [template = i32]
 // CHECK:STDOUT:   %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
-// CHECK:STDOUT:   %As.type.loc23_26: type = interface_type @As, @As(constants.%X) [template = constants.%As.type.3]
-// CHECK:STDOUT:   %.loc23_26.1: %.7 = specific_constant imports.%import_ref.4, @As(constants.%X) [template = constants.%.8]
-// CHECK:STDOUT:   %Convert.ref.loc23_26: %.7 = name_ref Convert, %.loc23_26.1 [template = constants.%.8]
-// CHECK:STDOUT:   %.loc23_26.2: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2]
-// CHECK:STDOUT:   %.loc23_26.3: <bound method> = bound_method %.loc23_16, %.loc23_26.2 [template = constants.%.16]
-// CHECK:STDOUT:   %.loc23_26.4: ref %X = temporary_storage
-// CHECK:STDOUT:   %Convert.call.loc23_26: init %X = call %.loc23_26.3(%.loc23_16) to %.loc23_26.4
-// CHECK:STDOUT:   %.loc23_26.5: init %X = converted %.loc23_16, %Convert.call.loc23_26
+// CHECK:STDOUT:   %.loc23_26.1: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2]
+// CHECK:STDOUT:   %.loc23_26.2: <bound method> = bound_method %.loc23_16, %.loc23_26.1 [template = constants.%.16]
+// CHECK:STDOUT:   %.loc23_26.3: ref %X = temporary_storage
+// CHECK:STDOUT:   %Convert.call.loc23_26: init %X = call %.loc23_26.2(%.loc23_16) to %.loc23_26.3
+// CHECK:STDOUT:   %.loc23_26.4: init %X = converted %.loc23_16, %Convert.call.loc23_26
 // CHECK:STDOUT:   %int.make_type_32.loc23_35: init type = call constants.%Int32() [template = i32]
 // CHECK:STDOUT:   %.loc23_35.1: type = value_of_initializer %int.make_type_32.loc23_35 [template = i32]
 // CHECK:STDOUT:   %.loc23_35.2: type = converted %int.make_type_32.loc23_35, %.loc23_35.1 [template = i32]
-// CHECK:STDOUT:   %As.type.loc23_32: type = interface_type @As, @As(i32) [template = constants.%As.type.4]
-// CHECK:STDOUT:   %.loc23_32.1: %.11 = specific_constant imports.%import_ref.4, @As(i32) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref.loc23_32: %.11 = name_ref Convert, %.loc23_32.1 [template = constants.%.12]
-// CHECK:STDOUT:   %.loc23_26.6: ref %X = temporary %.loc23_26.4, %.loc23_26.5
-// CHECK:STDOUT:   %.loc23_32.2: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4]
-// CHECK:STDOUT:   %.loc23_32.3: <bound method> = bound_method %.loc23_26.6, %.loc23_32.2
-// CHECK:STDOUT:   %.loc23_26.7: %X = bind_value %.loc23_26.6
-// CHECK:STDOUT:   %Convert.call.loc23_32: init i32 = call %.loc23_32.3(%.loc23_26.7)
-// CHECK:STDOUT:   %.loc23_32.4: i32 = value_of_initializer %Convert.call.loc23_32
-// CHECK:STDOUT:   %.loc23_32.5: i32 = converted %.loc23_26.5, %.loc23_32.4
-// CHECK:STDOUT:   %n: i32 = bind_name n, %.loc23_32.5
+// CHECK:STDOUT:   %.loc23_26.5: ref %X = temporary %.loc23_26.3, %.loc23_26.4
+// CHECK:STDOUT:   %.loc23_32.1: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4]
+// CHECK:STDOUT:   %.loc23_32.2: <bound method> = bound_method %.loc23_26.5, %.loc23_32.1
+// CHECK:STDOUT:   %.loc23_26.6: %X = bind_value %.loc23_26.5
+// CHECK:STDOUT:   %Convert.call.loc23_32: init i32 = call %.loc23_32.2(%.loc23_26.6)
+// CHECK:STDOUT:   %.loc23_32.3: i32 = value_of_initializer %Convert.call.loc23_32
+// CHECK:STDOUT:   %.loc23_32.4: i32 = converted %.loc23_26.4, %.loc23_32.3
+// CHECK:STDOUT:   %n: i32 = bind_name n, %.loc23_32.4
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/basics/fail_non_type_as_type.carbon

@@ -95,10 +95,7 @@ var x: type = 42;
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc17_15: i32 = int_value 42 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_17.1: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc17_17.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc17_17.2: type = converted %.loc17_15, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_17: type = converted %.loc17_15, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 3 - 9
toolchain/check/testdata/class/extend_adapt.carbon

@@ -339,10 +339,7 @@ class StructAdapter {
 // CHECK:STDOUT:   %a.ref: %SomeClassAdapter = name_ref a, %a
 // CHECK:STDOUT:   %F.ref: %F.type.1 = name_ref F, @SomeClass.%F.decl [template = constants.%F.1]
 // CHECK:STDOUT:   %.loc23_4: <bound method> = bound_method %a.ref, %F.ref
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc23_3.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref: %.8 = name_ref Convert, %.loc23_3.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc23_3.2: %SomeClass = converted %a.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc23_3: %SomeClass = converted %a.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %F.call: init %.1 = call %.loc23_4(<error>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
@@ -519,11 +516,8 @@ class StructAdapter {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %SomeClassAdapter = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %.2 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_11.1: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%SomeClass) [template = constants.%.10]
-// CHECK:STDOUT:   %Convert.ref: %.9 = name_ref Convert, %.loc21_11.1 [template = constants.%.10]
-// CHECK:STDOUT:   %.loc21_11.2: %SomeClass = converted %a.ref, <error> [template = <error>]
-// CHECK:STDOUT:   %.loc21_11.3: i32 = class_element_access <error>, element1 [template = <error>]
+// CHECK:STDOUT:   %.loc21_11.1: %SomeClass = converted %a.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_11.2: i32 = class_element_access <error>, element1 [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 8
toolchain/check/testdata/class/fail_adapt_bad_decl.carbon

@@ -183,10 +183,7 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @Bad {
 // CHECK:STDOUT:   %.loc12_9: i32 = int_value 100 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc12_12.1: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc12_12.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc12_12.2: type = converted %.loc12_9, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc12_12: type = converted %.loc12_9, <error> [template = <error>]
 // CHECK:STDOUT:   adapt_decl <error>
 // CHECK:STDOUT:   %.loc13: <witness> = complete_type_witness <error> [template = <error>]
 // CHECK:STDOUT:
@@ -324,10 +321,7 @@ class C {
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @Bad {
 // CHECK:STDOUT:   %.loc12_16: i32 = int_value 100 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc12_19.1: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc12_19.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc12_19.2: type = converted %.loc12_16, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc12_19: type = converted %.loc12_16, <error> [template = <error>]
 // CHECK:STDOUT:   adapt_decl <error>
 // CHECK:STDOUT:   %.loc13: <witness> = complete_type_witness <error> [template = <error>]
 // CHECK:STDOUT:

+ 5 - 20
toolchain/check/testdata/class/fail_base_bad_type.carbon

@@ -340,10 +340,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @DeriveFromNonType {
 // CHECK:STDOUT:   %.loc12_16.1: i32 = int_value 32 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc12_16.2: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc12_16.2 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc12_16.3: type = converted %.loc12_16.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc12_16.2: type = converted %.loc12_16.1, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc12_18: <error> = base_decl <error>, element0 [template]
 // CHECK:STDOUT:   %.loc13: <witness> = complete_type_witness <error> [template = <error>]
 // CHECK:STDOUT:
@@ -535,10 +532,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: fn @ConvertToBadBasei32(%p.param_patt: %.2) -> %.3 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.2 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.3) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_61.1: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.3) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc21_61.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc21_61.2: %.3 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_61: %.3 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -736,10 +730,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: fn @ConvertToBadBaseTuple(%p.param_patt: %.8) -> %.9 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.8 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.9) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_69.1: %.12 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.9) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref: %.12 = name_ref Convert, %.loc21_69.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc21_69.2: %.9 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_69: %.9 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -934,10 +925,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: fn @ConvertToBadBaseStruct(%p.param_patt: %.4) -> %.3 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.4 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.3) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_82.1: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.3) [template = constants.%.8]
-// CHECK:STDOUT:   %Convert.ref: %.7 = name_ref Convert, %.loc21_82.1 [template = constants.%.8]
-// CHECK:STDOUT:   %.loc21_82.2: %.3 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_82: %.3 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1120,10 +1108,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: fn @ConvertToBadBaseIncomplete(%p.param_patt: %.1) -> %.2 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.1 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.2) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc28_82.1: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.2) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc28_82.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc28_82.2: %.2 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc28_82: %.2 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 5
toolchain/check/testdata/class/fail_compound_type_mismatch.carbon

@@ -157,11 +157,8 @@ fn AccessBInA(a: A) -> i32 {
 // CHECK:STDOUT:   %a.ref: %A = name_ref a, %a
 // CHECK:STDOUT:   %B.ref: type = name_ref B, file.%B.decl [template = constants.%B]
 // CHECK:STDOUT:   %b.ref: %.5 = name_ref b, @B.%.loc16_8 [template = @B.%.loc16_8]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%B) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc26_11.1: %.12 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%B) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref: %.12 = name_ref Convert, %.loc26_11.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc26_11.2: %B = converted %a.ref, <error> [template = <error>]
-// CHECK:STDOUT:   %.loc26_11.3: i32 = class_element_access <error>, element0 [template = <error>]
+// CHECK:STDOUT:   %.loc26_11.1: %B = converted %a.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc26_11.2: i32 = class_element_access <error>, element0 [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 8
toolchain/check/testdata/class/fail_derived_to_base.carbon

@@ -224,10 +224,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
 // CHECK:STDOUT: fn @ConvertUnrelated(%p.param_patt: %.11) -> %.12 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.11 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.12) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc31_46.1: %.18 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.12) [template = constants.%.19]
-// CHECK:STDOUT:   %Convert.ref: %.18 = name_ref Convert, %.loc31_46.1 [template = constants.%.19]
-// CHECK:STDOUT:   %.loc31_46.2: %.12 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc31_46: %.12 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -242,10 +239,7 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
 // CHECK:STDOUT: fn @ConvertIncomplete(%p.param_patt: %.21) -> %.22 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.21 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.22) [template = constants.%ImplicitAs.type.4]
-// CHECK:STDOUT:   %.loc41_55.1: %.23 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.22) [template = constants.%.24]
-// CHECK:STDOUT:   %Convert.ref: %.23 = name_ref Convert, %.loc41_55.1 [template = constants.%.24]
-// CHECK:STDOUT:   %.loc41_55.2: %.22 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc41_55: %.22 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/class/fail_self.carbon

@@ -224,10 +224,7 @@ fn CallWrongSelf(ws: WrongSelf) {
 // CHECK:STDOUT:   %ws.ref: %WrongSelf = name_ref ws, %ws
 // CHECK:STDOUT:   %F.ref: %F.type.2 = name_ref F, @WrongSelf.%F.decl [template = constants.%F.2]
 // CHECK:STDOUT:   %.loc55_5: <bound method> = bound_method %ws.ref, %F.ref
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc55_3.1: %.7 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class) [template = constants.%.8]
-// CHECK:STDOUT:   %Convert.ref: %.7 = name_ref Convert, %.loc55_3.1 [template = constants.%.8]
-// CHECK:STDOUT:   %.loc55_3.2: %Class = converted %ws.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc55_3: %Class = converted %ws.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %F.call: init %.1 = call %.loc55_5(<error>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/class/generic/call.carbon

@@ -447,10 +447,7 @@ class Outer(T:! type) {
 // CHECK:STDOUT:   %.loc15_20.1: type = value_of_initializer %int.make_type_32 [template = i32]
 // CHECK:STDOUT:   %.loc15_20.2: type = converted %int.make_type_32, %.loc15_20.1 [template = i32]
 // CHECK:STDOUT:   %.loc15_20.3: type = ptr_type i32 [template = constants.%.5]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc15_13.1: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref: %.8 = name_ref Convert, %.loc15_13.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc15_13.2: type = converted %.loc15_14, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc15_13: type = converted %.loc15_14, <error> [template = <error>]
 // CHECK:STDOUT:   %a.var: ref <error> = var a
 // CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/class/generic/import.carbon

@@ -732,11 +732,8 @@ class Class(U:! type) {
 // CHECK:STDOUT:   %F.ref: %F.type.3 = name_ref F, imports.%import_ref.3 [template = constants.%F.3]
 // CHECK:STDOUT:   %.loc14_33.1: ref %CompleteClass.4 = temporary_storage
 // CHECK:STDOUT:   %F.call: init %CompleteClass.4 = call %F.ref() to %.loc14_33.1
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc14_35.1: %.11 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%CompleteClass.3) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref: %.11 = name_ref Convert, %.loc14_35.1 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc14_33.2: ref %CompleteClass.4 = temporary %.loc14_33.1, %F.call
-// CHECK:STDOUT:   %.loc14_35.2: %CompleteClass.3 = converted %F.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc14_35: %CompleteClass.3 = converted %F.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign %v.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 13
toolchain/check/testdata/class/generic/member_access.carbon

@@ -538,10 +538,6 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
 // CHECK:STDOUT:   %Make.type: type = fn_type @Make, @Class(%T.loc8_29.2) [symbolic = %Make.type (constants.%Make.type)]
 // CHECK:STDOUT:   %Make: @StaticMemberFunctionCall.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)]
 // CHECK:STDOUT:   %.loc15_18.3: <specific function> = specific_function %Make, @Make(%T.loc8_29.2) [symbolic = %.loc15_18.3 (constants.%.5)]
-// CHECK:STDOUT:   %ImplicitAs.type.loc15_25.2: type = interface_type @ImplicitAs, @ImplicitAs(%Class.loc8_47.2) [symbolic = %ImplicitAs.type.loc15_25.2 (constants.%ImplicitAs.type.3)]
-// CHECK:STDOUT:   %Convert.type: type = fn_type @Convert, @ImplicitAs(%Class.loc8_47.2) [symbolic = %Convert.type (constants.%Convert.type.2)]
-// CHECK:STDOUT:   %.loc15_25.3: type = assoc_entity_type @StaticMemberFunctionCall.%ImplicitAs.type.loc15_25.2 (%ImplicitAs.type.3), @StaticMemberFunctionCall.%Convert.type (%Convert.type.2) [symbolic = %.loc15_25.3 (constants.%.8)]
-// CHECK:STDOUT:   %.loc15_25.4: @StaticMemberFunctionCall.%.loc15_25.3 (%.8) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.loc15_25.4 (constants.%.9)]
 // CHECK:STDOUT:
 // CHECK:STDOUT:   fn(%T.param_patt: type) -> %return: @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) {
 // CHECK:STDOUT:   !entry:
@@ -553,11 +549,8 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
 // CHECK:STDOUT:     %.loc15_18.2: <specific function> = specific_function %Make.ref, @Make(constants.%T) [symbolic = %.loc15_18.3 (constants.%.5)]
 // CHECK:STDOUT:     %.loc15_23.1: ref @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = temporary_storage
 // CHECK:STDOUT:     %Make.call: init @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = call %.loc15_18.2() to %.loc15_23.1
-// CHECK:STDOUT:     %ImplicitAs.type.loc15_25.1: type = interface_type @ImplicitAs, @ImplicitAs(constants.%Class.2) [symbolic = %ImplicitAs.type.loc15_25.2 (constants.%ImplicitAs.type.3)]
-// CHECK:STDOUT:     %.loc15_25.1: @StaticMemberFunctionCall.%.loc15_25.3 (%.8) = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class.2) [symbolic = %.loc15_25.4 (constants.%.9)]
-// CHECK:STDOUT:     %Convert.ref: @StaticMemberFunctionCall.%.loc15_25.3 (%.8) = name_ref Convert, %.loc15_25.1 [symbolic = %.loc15_25.4 (constants.%.9)]
 // CHECK:STDOUT:     %.loc15_23.2: ref @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = temporary %.loc15_23.1, %Make.call
-// CHECK:STDOUT:     %.loc15_25.2: @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = converted %Make.call, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc15_25: @StaticMemberFunctionCall.%Class.loc8_47.2 (%Class.2) = converted %Make.call, <error> [template = <error>]
 // CHECK:STDOUT:     return <error> to %return
 // CHECK:STDOUT:   }
 // CHECK:STDOUT: }
@@ -647,8 +640,3 @@ fn StaticMemberFunctionCall(T:! type) -> Class(T) {
 // CHECK:STDOUT:   %Class.loc5_21.1 => constants.%Class.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: specific @ImplicitAs(@StaticMemberFunctionCall.%Class.loc8_47.2) {
-// CHECK:STDOUT:   %Dest => constants.%Class.2
-// CHECK:STDOUT:   %Dest.patt => constants.%Class.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:

+ 4 - 16
toolchain/check/testdata/class/init_adapt.carbon

@@ -418,34 +418,22 @@ var e: C = MakeAdaptC();
 // CHECK:STDOUT:   %.loc13_28.2: %C = bind_value %.loc13_28.1
 // CHECK:STDOUT:   %a: %C = bind_name a, %.loc13_28.2
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
-// CHECK:STDOUT:   %ImplicitAs.type.loc24: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc24_18.1: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref.loc24: %.11 = name_ref Convert, %.loc24_18.1 [template = constants.%.12]
-// CHECK:STDOUT:   %.loc24_18.2: %AdaptC = converted %a.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc24: %AdaptC = converted %a.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %b: %AdaptC = bind_name b, <error>
 // CHECK:STDOUT:   %b.ref: %AdaptC = name_ref b, %b
-// CHECK:STDOUT:   %ImplicitAs.type.loc33: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.4]
-// CHECK:STDOUT:   %.loc33_13.1: %.14 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.15]
-// CHECK:STDOUT:   %Convert.ref.loc33: %.14 = name_ref Convert, %.loc33_13.1 [template = constants.%.15]
-// CHECK:STDOUT:   %.loc33_13.2: %C = converted %b.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc33: %C = converted %b.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %c: %C = bind_name c, <error>
 // CHECK:STDOUT:   %MakeC.ref: %MakeC.type = name_ref MakeC, file.%MakeC.decl [template = constants.%MakeC]
 // CHECK:STDOUT:   %.loc46_22.1: ref %C = temporary_storage
 // CHECK:STDOUT:   %MakeC.call: init %C = call %MakeC.ref() to %.loc46_22.1
-// CHECK:STDOUT:   %ImplicitAs.type.loc46: type = interface_type @ImplicitAs, @ImplicitAs(constants.%AdaptC) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc46_24.1: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%AdaptC) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref.loc46: %.11 = name_ref Convert, %.loc46_24.1 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc46_22.2: ref %C = temporary %.loc46_22.1, %MakeC.call
-// CHECK:STDOUT:   %.loc46_24.2: %AdaptC = converted %MakeC.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc46_24: %AdaptC = converted %MakeC.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%d.var, <error>
 // CHECK:STDOUT:   %MakeAdaptC.ref: %MakeAdaptC.type = name_ref MakeAdaptC, file.%MakeAdaptC.decl [template = constants.%MakeAdaptC]
 // CHECK:STDOUT:   %.loc54_22.1: ref %AdaptC = temporary_storage
 // CHECK:STDOUT:   %MakeAdaptC.call: init %AdaptC = call %MakeAdaptC.ref() to %.loc54_22.1
-// CHECK:STDOUT:   %ImplicitAs.type.loc54: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.4]
-// CHECK:STDOUT:   %.loc54_24.1: %.14 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%C) [template = constants.%.15]
-// CHECK:STDOUT:   %Convert.ref.loc54: %.14 = name_ref Convert, %.loc54_24.1 [template = constants.%.15]
 // CHECK:STDOUT:   %.loc54_22.2: ref %AdaptC = temporary %.loc54_22.1, %MakeAdaptC.call
-// CHECK:STDOUT:   %.loc54_24.2: %C = converted %MakeAdaptC.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc54_24: %C = converted %MakeAdaptC.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%e.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/class/self.carbon

@@ -263,10 +263,7 @@ class Class {
 // CHECK:STDOUT:   } {
 // CHECK:STDOUT:     %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class]
 // CHECK:STDOUT:     %self.ref: %Class = name_ref self, %self
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc18_25.1: %.4 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.5]
-// CHECK:STDOUT:     %Convert.ref: %.4 = name_ref Convert, %.loc18_25.1 [template = constants.%.5]
-// CHECK:STDOUT:     %.loc18_25.2: type = converted %self.ref, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc18: type = converted %self.ref, <error> [template = <error>]
 // CHECK:STDOUT:     %self.param: %Class = value_param runtime_param0
 // CHECK:STDOUT:     %self: %Class = bind_name self, %self.param
 // CHECK:STDOUT:     %return.param: ref <error> = out_param runtime_param1

+ 1 - 4
toolchain/check/testdata/const/fail_collapse.carbon

@@ -126,10 +126,7 @@ fn G(p: const (const i32)**) -> i32** {
 // CHECK:STDOUT: fn @G(%p.param_patt: %.4) -> %.6 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.4 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.6) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc22_11.1: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.6) [template = constants.%.10]
-// CHECK:STDOUT:   %Convert.ref: %.9 = name_ref Convert, %.loc22_11.1 [template = constants.%.10]
-// CHECK:STDOUT:   %.loc22_11.2: %.6 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc22: %.6 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/deduce/array.carbon

@@ -694,10 +694,7 @@ fn G() -> C {
 // CHECK:STDOUT:   %a.ref: ref %.10 = name_ref a, %a
 // CHECK:STDOUT:   %.loc21_10: <specific function> = specific_function %F.ref, @F(constants.%C) [template = constants.%.15]
 // CHECK:STDOUT:   %.loc8_8.2: ref %C = splice_block %return {}
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.14) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_12.1: %.19 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.14) [template = constants.%.20]
-// CHECK:STDOUT:   %Convert.ref: %.19 = name_ref Convert, %.loc21_12.1 [template = constants.%.20]
-// CHECK:STDOUT:   %.loc21_12.2: %.14 = converted %a.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_12: %.14 = converted %a.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %F.call: init %C = call %.loc21_10(<error>) to %.loc8_8.2
 // CHECK:STDOUT:   return %F.call to %return
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon

@@ -164,7 +164,6 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
 // CHECK:STDOUT:   %int.make_type_32: init type = call constants.%Int32() [template = i32]
 // CHECK:STDOUT:   %.loc10_16: i32 = int_value 1 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc10_20: i32 = int_value 2 [template = constants.%.4]
-// CHECK:STDOUT:   %Op.ref: %.5 = name_ref Op, imports.%import_ref.4 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc10_18.1: %Op.type.2 = interface_witness_access constants.%.2, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc10_18.2: <bound method> = bound_method %.loc10_16, %.loc10_18.1 [template = constants.%.7]
 // CHECK:STDOUT:   %int.sadd: init i32 = call %.loc10_18.2(%.loc10_16, %.loc10_20) [template = constants.%.8]
@@ -224,7 +223,6 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
 // CHECK:STDOUT:   %.loc10_29: i32 = int_value 4 [template = constants.%.11]
 // CHECK:STDOUT:   %.loc10_32: i32 = int_value 3 [template = constants.%.8]
 // CHECK:STDOUT:   %.loc10_36: i32 = int_value 4 [template = constants.%.11]
-// CHECK:STDOUT:   %Op.ref: %.5 = name_ref Op, imports.%import_ref.4 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc10_34.1: %Op.type.2 = interface_witness_access constants.%.2, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc10_34.2: <bound method> = bound_method %.loc10_32, %.loc10_34.1 [template = constants.%.12]
 // CHECK:STDOUT:   %int.sadd: init i32 = call %.loc10_34.2(%.loc10_32, %.loc10_36) [template = constants.%.13]

+ 1 - 4
toolchain/check/testdata/function/call/fail_param_type.carbon

@@ -120,10 +120,7 @@ fn F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G]
 // CHECK:STDOUT:   %.loc23_5.1: f64 = float_literal 1 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc23_5.2: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc23_5.2 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc23_5.3: i32 = converted %.loc23_5.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc23_5.2: i32 = converted %.loc23_5.1, <error> [template = <error>]
 // CHECK:STDOUT:   %G.call: init %.1 = call %G.ref(<error>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon

@@ -129,12 +129,9 @@ fn Run() {
 // CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
 // CHECK:STDOUT:   %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo]
 // CHECK:STDOUT:   %Foo.call: init f64 = call %Foo.ref()
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc20_21.1: %.6 = specific_constant imports.%import_ref.5, @ImplicitAs(i32) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc20_21.1 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc20_19.1: ref f64 = temporary_storage
 // CHECK:STDOUT:   %.loc20_19.2: ref f64 = temporary %.loc20_19.1, %Foo.call
-// CHECK:STDOUT:   %.loc20_21.2: i32 = converted %Foo.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc20_21: i32 = converted %Foo.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/function/generic/resolve_used.carbon

@@ -159,10 +159,7 @@ fn CallNegative() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %ErrorIfNIsZero.ref: %ErrorIfNIsZero.type = name_ref ErrorIfNIsZero, file.%ErrorIfNIsZero.decl [template = constants.%ErrorIfNIsZero]
 // CHECK:STDOUT:   %.loc24_18: i32 = int_value 0 [template = constants.%.3]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(Core.IntLiteral) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc24_17.1: %.6 = specific_constant imports.%import_ref.5, @ImplicitAs(Core.IntLiteral) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc24_17.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc24_17.2: Core.IntLiteral = converted %.loc24_18, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc24_17: Core.IntLiteral = converted %.loc24_18, <error> [template = <error>]
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/impl/fail_impl_bad_interface.carbon

@@ -67,10 +67,7 @@ impl i32 as false {}
 // CHECK:STDOUT:     .Core = imports.%Core
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_13.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc21_13.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc21_13.2: type = converted @impl.%.loc21_13, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21: type = converted @impl.%.loc21_13, <error> [template = <error>]
 // CHECK:STDOUT:   impl_decl @impl [template] {} {
 // CHECK:STDOUT:     %int.make_type_32: init type = call constants.%Int32() [template = i32]
 // CHECK:STDOUT:     %.loc21_6.1: type = value_of_initializer %int.make_type_32 [template = i32]

+ 3 - 6
toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon

@@ -85,12 +85,9 @@ impl bool as I where .T = bool {}
 // CHECK:STDOUT:     %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %T.ref: %.1 = name_ref T, @I.%.loc11 [template = constants.%.2]
 // CHECK:STDOUT:     %bool.make_type.loc23_27: init type = call constants.%Bool() [template = bool]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.1) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc23_27.1: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.1) [template = constants.%.7]
-// CHECK:STDOUT:     %Convert.ref: %.6 = name_ref Convert, %.loc23_27.1 [template = constants.%.7]
-// CHECK:STDOUT:     %.loc23_27.2: ref type = temporary_storage
-// CHECK:STDOUT:     %.loc23_27.3: ref type = temporary %.loc23_27.2, %bool.make_type.loc23_27
-// CHECK:STDOUT:     %.loc23_27.4: %.1 = converted %bool.make_type.loc23_27, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc23_27.1: ref type = temporary_storage
+// CHECK:STDOUT:     %.loc23_27.2: ref type = temporary %.loc23_27.1, %bool.make_type.loc23_27
+// CHECK:STDOUT:     %.loc23_27.3: %.1 = converted %bool.make_type.loc23_27, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc23_16: type = where_expr %.Self [template = constants.%.9] {
 // CHECK:STDOUT:       requirement_rewrite %T.ref, <error>
 // CHECK:STDOUT:     }

+ 1 - 4
toolchain/check/testdata/index/fail_array_non_int_indexing.carbon

@@ -129,10 +129,7 @@ var b: i32 = a[2.6];
 // CHECK:STDOUT:   assign file.%a.var, %.loc11_24
 // CHECK:STDOUT:   %a.ref: ref %.3 = name_ref a, file.%a
 // CHECK:STDOUT:   %.loc18_16.1: f64 = float_literal 2.6000000000000001 [template = constants.%.8]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_16.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref: %.11 = name_ref Convert, %.loc18_16.2 [template = constants.%.12]
-// CHECK:STDOUT:   %.loc18_16.3: i32 = converted %.loc18_16.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_16.2: i32 = converted %.loc18_16.1, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc18_19.1: ref i32 = array_index %a.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc18_19.2: i32 = bind_value %.loc18_19.1
 // CHECK:STDOUT:   assign file.%b.var, %.loc18_19.2

+ 0 - 1
toolchain/check/testdata/index/fail_negative_indexing.carbon

@@ -105,7 +105,6 @@ var d: i32 = c[-10];
 // CHECK:STDOUT:   assign file.%c.var, %.loc11_27
 // CHECK:STDOUT:   %c.ref: ref %.3 = name_ref c, file.%c
 // CHECK:STDOUT:   %.loc15_17: i32 = int_value 10 [template = constants.%.9]
-// CHECK:STDOUT:   %Op.ref: %.10 = name_ref Op, imports.%import_ref.4 [template = constants.%.11]
 // CHECK:STDOUT:   %.loc15_19.1: ref i32 = array_index %c.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %.loc15_19.2: i32 = bind_value %.loc15_19.1
 // CHECK:STDOUT:   assign file.%d.var, %.loc15_19.2

+ 3 - 6
toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon

@@ -72,16 +72,13 @@ interface I {
 // CHECK:STDOUT: interface @I {
 // CHECK:STDOUT:   %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1]
 // CHECK:STDOUT:   %.loc18_18: i32 = int_value 42 [template = constants.%.1]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_20.1: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc18_20.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc18_20.2: type = converted %.loc18_18, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_20.1: type = converted %.loc18_18, <error> [template = <error>]
 // CHECK:STDOUT:   %T: type = assoc_const_decl T [template]
-// CHECK:STDOUT:   %.loc18_20.3: %.8 = assoc_entity element0, %T [template = constants.%.9]
+// CHECK:STDOUT:   %.loc18_20.2: %.8 = assoc_entity element0, %T [template = constants.%.9]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
 // CHECK:STDOUT:   .Self = %Self
-// CHECK:STDOUT:   .T = %.loc18_20.3
+// CHECK:STDOUT:   .T = %.loc18_20.2
 // CHECK:STDOUT:   witness = (%T)
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/let/compile_time_bindings.carbon

@@ -708,10 +708,7 @@ impl i32 as Empty {
 // CHECK:STDOUT:     %return.param_patt: <error> = out_param_pattern %return.patt, runtime_param0
 // CHECK:STDOUT:   } {
 // CHECK:STDOUT:     %T.ref: %.2 = name_ref T, @I.%.loc5_21.3 [template = constants.%.3]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc13_13.1: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.7]
-// CHECK:STDOUT:     %Convert.ref: %.6 = name_ref Convert, %.loc13_13.1 [template = constants.%.7]
-// CHECK:STDOUT:     %.loc13_13.2: type = converted %T.ref, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc13: type = converted %T.ref, <error> [template = <error>]
 // CHECK:STDOUT:     %return.param: ref <error> = out_param runtime_param0
 // CHECK:STDOUT:     %return: ref <error> = return_slot %return.param
 // CHECK:STDOUT:   }

+ 2 - 8
toolchain/check/testdata/let/fail_generic.carbon

@@ -133,16 +133,10 @@ fn F(a: i32) -> i32 {
 // CHECK:STDOUT:   %T: type = bind_symbolic_name T, 0, %.loc13_21.2 [symbolic = constants.%T]
 // CHECK:STDOUT:   %T.ref: type = name_ref T, %T [symbolic = constants.%T]
 // CHECK:STDOUT:   %.loc21_14: i32 = int_value 5 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type.loc21: type = interface_type @ImplicitAs, @ImplicitAs(constants.%T) [symbolic = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc21_15.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%T) [symbolic = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref.loc21: %.5 = name_ref Convert, %.loc21_15.1 [symbolic = constants.%.6]
-// CHECK:STDOUT:   %.loc21_15.2: %T = converted %.loc21_14, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc21_15: %T = converted %.loc21_14, <error> [template = <error>]
 // CHECK:STDOUT:   %x: %T = bind_name x, <error>
 // CHECK:STDOUT:   %x.ref: %T = name_ref x, %x
-// CHECK:STDOUT:   %ImplicitAs.type.loc28: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.4]
-// CHECK:STDOUT:   %.loc28_11.1: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref.loc28: %.8 = name_ref Convert, %.loc28_11.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc28_11.2: i32 = converted %x.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc28: i32 = converted %x.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 5
toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon

@@ -99,11 +99,8 @@ fn Main() {
 // CHECK:STDOUT:   %x.var: ref bool = var x
 // CHECK:STDOUT:   %x: ref bool = bind_name x, %x.var
 // CHECK:STDOUT:   %.loc18_21: i32 = int_value 12 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(bool) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_17.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(bool) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc18_17.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc18_17.2: bool = converted %.loc18_21, <error> [template = <error>]
-// CHECK:STDOUT:   %.loc18_17.3: <error> = not <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_17.1: bool = converted %.loc18_21, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_17.2: <error> = not <error> [template = <error>]
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon

@@ -104,10 +104,7 @@ fn Main() {
 // CHECK:STDOUT:   assign %a.var, %.loc12_16
 // CHECK:STDOUT:   %a.ref: ref i32 = name_ref a, %a
 // CHECK:STDOUT:   %.loc19_7: f64 = float_literal 5.6000000000000005 [template = constants.%.3]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc19_5.1: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc19_5.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc19_5.2: i32 = converted %.loc19_7, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc19_5: i32 = converted %.loc19_7, <error> [template = <error>]
 // CHECK:STDOUT:   assign %a.ref, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 0 - 2
toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon

@@ -85,9 +85,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc21_10: i32 = int_value 12 [template = constants.%.2]
 // CHECK:STDOUT:   %.loc21_15: f64 = float_literal 3.4000000000000004 [template = constants.%.3]
-// CHECK:STDOUT:   %Op.ref.loc21_13: %.4 = name_ref Op, imports.%import_ref.4 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc21_21: i32 = int_value 12 [template = constants.%.2]
-// CHECK:STDOUT:   %Op.ref.loc21_19: %.4 = name_ref Op, imports.%import_ref.4 [template = constants.%.5]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 1
toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon

@@ -79,7 +79,6 @@ fn Main() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc15_10: i32 = int_value 12 [template = constants.%.2]
 // CHECK:STDOUT:   %.loc15_15: i32 = int_value 34 [template = constants.%.3]
-// CHECK:STDOUT:   %Op.ref: %.4 = name_ref Op, imports.%import_ref.4 [template = constants.%.5]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/operators/overloaded/add.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 2
toolchain/check/testdata/operators/overloaded/bit_and.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 1
toolchain/check/testdata/operators/overloaded/bit_complement.carbon

@@ -139,7 +139,6 @@ fn TestOp(a: C) -> C {
 // CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return: %C {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
-// CHECK:STDOUT:   %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc24_10.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc24_10.2: <bound method> = bound_method %a.ref, %.loc24_10.1
 // CHECK:STDOUT:   %.loc23_17.2: ref %C = splice_block %return {}

+ 0 - 2
toolchain/check/testdata/operators/overloaded/bit_or.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 2
toolchain/check/testdata/operators/overloaded/bit_xor.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 1
toolchain/check/testdata/operators/overloaded/dec.carbon

@@ -127,7 +127,6 @@ fn TestOp() {
 // CHECK:STDOUT:   %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%struct]
 // CHECK:STDOUT:   assign %c.var, %.loc22_16
 // CHECK:STDOUT:   %c.ref: ref %C = name_ref c, %c
-// CHECK:STDOUT:   %Op.ref: %.8 = name_ref Op, imports.%import_ref.3 [template = constants.%.9]
 // CHECK:STDOUT:   %.loc23_3.1: %Op.type.2 = interface_witness_access constants.%.6, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc23_3.2: <bound method> = bound_method %c.ref, %.loc23_3.1
 // CHECK:STDOUT:   %.loc23_5: %.3 = addr_of %c.ref

+ 0 - 2
toolchain/check/testdata/operators/overloaded/div.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 1 - 10
toolchain/check/testdata/operators/overloaded/eq.carbon

@@ -273,7 +273,6 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Equal.ref: %.6 = name_ref Equal, imports.%import_ref.3 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc12_12.1: %Equal.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Equal.1]
 // CHECK:STDOUT:   %.loc12_12.2: <bound method> = bound_method %a.ref, %.loc12_12.1
 // CHECK:STDOUT:   %Equal.call: init bool = call %.loc12_12.2(%a.ref, %b.ref)
@@ -286,7 +285,6 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %NotEqual.ref: %.8 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.9]
 // CHECK:STDOUT:   %.loc16_12.1: %NotEqual.type.2 = interface_witness_access constants.%.4, element1 [template = constants.%NotEqual.1]
 // CHECK:STDOUT:   %.loc16_12.2: <bound method> = bound_method %a.ref, %.loc16_12.1
 // CHECK:STDOUT:   %NotEqual.call: init bool = call %.loc16_12.2(%a.ref, %b.ref)
@@ -427,7 +425,6 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Equal.ref: %.5 = name_ref Equal, imports.%import_ref.4 [template = constants.%.6]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -441,7 +438,6 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %NotEqual.ref: %.7 = name_ref NotEqual, imports.%import_ref.5 [template = constants.%.8]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -704,13 +700,9 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Equal.ref: %.6 = name_ref Equal, imports.%import_ref.3 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc23_12.1: %Equal.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Equal.1]
 // CHECK:STDOUT:   %.loc23_12.2: <bound method> = bound_method %a.ref, %.loc23_12.1
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc23_15.1: %.10 = specific_constant imports.%import_ref.11, @ImplicitAs(constants.%C) [template = constants.%.11]
-// CHECK:STDOUT:   %Convert.ref: %.10 = name_ref Convert, %.loc23_15.1 [template = constants.%.11]
-// CHECK:STDOUT:   %.loc23_15.2: %C = converted %b.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc23_15: %C = converted %b.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %Equal.call: init bool = call %.loc23_12.2(%a.ref, <error>)
 // CHECK:STDOUT:   %.loc23_16.1: bool = value_of_initializer %Equal.call
 // CHECK:STDOUT:   %.loc23_16.2: bool = converted %Equal.call, %.loc23_16.1
@@ -729,7 +721,6 @@ fn TestLhsBad(a: D, b: C) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %NotEqual.ref: %.13 = name_ref NotEqual, imports.%import_ref.4 [template = constants.%.14]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon

@@ -219,7 +219,6 @@ fn TestAddAssignNonRef(a: C, b: C) {
 // CHECK:STDOUT: fn @TestIncNonRef(%a.param_patt: %C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
-// CHECK:STDOUT:   %Op.ref: %.10 = name_ref Op, imports.%import_ref.3 [template = constants.%.11]
 // CHECK:STDOUT:   %.loc30_3.1: %Op.type.2 = interface_witness_access constants.%.6, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc30_3.2: <bound method> = bound_method %a.ref, %.loc30_3.1
 // CHECK:STDOUT:   %Op.call: init %.4 = call %.loc30_3.2(<error>)
@@ -230,7 +229,6 @@ fn TestAddAssignNonRef(a: C, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.12 = name_ref Op, imports.%import_ref.7 [template = constants.%.13]
 // CHECK:STDOUT:   %.loc40_5.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc40_5.2: <bound method> = bound_method %a.ref, %.loc40_5.1
 // CHECK:STDOUT:   %Op.call: init %.4 = call %.loc40_5.2(<error>, %b.ref)

+ 2 - 6
toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon

@@ -204,7 +204,6 @@ fn TestRef(b: C) {
 // CHECK:STDOUT: fn @TestUnary(%a.param_patt: %C) -> %return: %C {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
-// CHECK:STDOUT:   %Op.ref: %.5 = name_ref Op, imports.%import_ref.3 [template = constants.%.6]
 // CHECK:STDOUT:   return <error> to %return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -218,7 +217,6 @@ fn TestRef(b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.7 = name_ref Op, imports.%import_ref.8 [template = constants.%.8]
 // CHECK:STDOUT:   return <error> to %return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -239,9 +237,7 @@ fn TestRef(b: C) {
 // CHECK:STDOUT:   assign %a.var, %.loc32_16
 // CHECK:STDOUT:   %a.ref.loc37: ref %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref.loc37: %.10 = name_ref Op, imports.%import_ref.13 [template = constants.%.11]
 // CHECK:STDOUT:   %a.ref.loc41: ref %C = name_ref a, %a
-// CHECK:STDOUT:   %Op.ref.loc41: %.13 = name_ref Op, imports.%import_ref.18 [template = constants.%.14]
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -249,14 +245,14 @@ fn TestRef(b: C) {
 // CHECK:STDOUT:   %Self: %AddAssign.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.3)]
 // CHECK:STDOUT:   %.2: type = ptr_type @Op.3.%Self (%Self.3) [symbolic = %.2 (constants.%.9)]
 // CHECK:STDOUT:
-// CHECK:STDOUT:   fn[addr <unexpected>.inst+126: @Op.3.%.2 (%.9)](%other.param_patt: @Op.3.%Self (%Self.3));
+// CHECK:STDOUT:   fn[addr <unexpected>.inst+124: @Op.3.%.2 (%.9)](%other.param_patt: @Op.3.%Self (%Self.3));
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: generic fn @Op.4(constants.%Self.4: %Inc.type) {
 // CHECK:STDOUT:   %Self: %Inc.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.4)]
 // CHECK:STDOUT:   %.2: type = ptr_type @Op.4.%Self (%Self.4) [symbolic = %.2 (constants.%.12)]
 // CHECK:STDOUT:
-// CHECK:STDOUT:   fn[addr <unexpected>.inst+153: @Op.4.%.2 (%.12)]();
+// CHECK:STDOUT:   fn[addr <unexpected>.inst+150: @Op.4.%.2 (%.12)]();
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: specific @Op.1(constants.%Self.1) {

+ 2 - 10
toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon

@@ -294,14 +294,10 @@ fn TestAssign(b: D) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc34_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc34_12.2: <bound method> = bound_method %a.ref, %.loc34_12.1
 // CHECK:STDOUT:   %.loc23_21.2: ref %C = splice_block %return {}
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc34_14.1: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref: %.13 = name_ref Convert, %.loc34_14.1 [template = constants.%.14]
-// CHECK:STDOUT:   %.loc34_14.2: %C = converted %b.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc34_14: %C = converted %b.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %Op.call: init %C = call %.loc34_12.2(%a.ref, <error>) to %.loc23_21.2
 // CHECK:STDOUT:   return %Op.call to %return
 // CHECK:STDOUT: }
@@ -325,14 +321,10 @@ fn TestAssign(b: D) {
 // CHECK:STDOUT:   assign %a.var, %.loc38_16
 // CHECK:STDOUT:   %a.ref: ref %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.16 = name_ref Op, imports.%import_ref.7 [template = constants.%.17]
 // CHECK:STDOUT:   %.loc48_5.1: %Op.type.4 = interface_witness_access constants.%.7, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc48_5.2: <bound method> = bound_method %a.ref, %.loc48_5.1
 // CHECK:STDOUT:   %.loc48_3: %.5 = addr_of %a.ref
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc48_8.1: %.13 = specific_constant imports.%import_ref.12, @ImplicitAs(constants.%C) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref: %.13 = name_ref Convert, %.loc48_8.1 [template = constants.%.14]
-// CHECK:STDOUT:   %.loc48_8.2: %C = converted %b.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc48_8: %C = converted %b.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %Op.call: init %.3 = call %.loc48_5.2(%.loc48_3, <error>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 19 - 25
toolchain/check/testdata/operators/overloaded/implicit_as.carbon

@@ -302,17 +302,14 @@ fn Test() {
 // CHECK:STDOUT:   %.loc30_12: <specific function> = specific_function %Source.ref.loc30, @Source(constants.%X) [template = constants.%.15]
 // CHECK:STDOUT:   %.loc30_18.1: ref %X = temporary_storage
 // CHECK:STDOUT:   %Source.call.loc30: init %X = call %.loc30_12() to %.loc30_18.1
-// CHECK:STDOUT:   %ImplicitAs.type.loc30: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.4]
-// CHECK:STDOUT:   %.loc30_18.2: %.11 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.12]
-// CHECK:STDOUT:   %Convert.ref.loc30: %.11 = name_ref Convert, %.loc30_18.2 [template = constants.%.12]
-// CHECK:STDOUT:   %.loc30_18.3: ref %X = temporary %.loc30_18.1, %Source.call.loc30
-// CHECK:STDOUT:   %.loc30_18.4: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4]
-// CHECK:STDOUT:   %.loc30_18.5: <bound method> = bound_method %.loc30_18.3, %.loc30_18.4
-// CHECK:STDOUT:   %.loc30_18.6: %X = bind_value %.loc30_18.3
-// CHECK:STDOUT:   %Convert.call.loc30: init i32 = call %.loc30_18.5(%.loc30_18.6)
-// CHECK:STDOUT:   %.loc30_18.7: i32 = value_of_initializer %Convert.call.loc30
-// CHECK:STDOUT:   %.loc30_18.8: i32 = converted %Source.call.loc30, %.loc30_18.7
-// CHECK:STDOUT:   %Sink_i32.call: init %.1 = call %Sink_i32.ref(%.loc30_18.8)
+// CHECK:STDOUT:   %.loc30_18.2: ref %X = temporary %.loc30_18.1, %Source.call.loc30
+// CHECK:STDOUT:   %.loc30_18.3: %Convert.type.5 = interface_witness_access constants.%.13, element0 [template = constants.%Convert.4]
+// CHECK:STDOUT:   %.loc30_18.4: <bound method> = bound_method %.loc30_18.2, %.loc30_18.3
+// CHECK:STDOUT:   %.loc30_18.5: %X = bind_value %.loc30_18.2
+// CHECK:STDOUT:   %Convert.call.loc30: init i32 = call %.loc30_18.4(%.loc30_18.5)
+// CHECK:STDOUT:   %.loc30_18.6: i32 = value_of_initializer %Convert.call.loc30
+// CHECK:STDOUT:   %.loc30_18.7: i32 = converted %Source.call.loc30, %.loc30_18.6
+// CHECK:STDOUT:   %Sink_i32.call: init %.1 = call %Sink_i32.ref(%.loc30_18.7)
 // CHECK:STDOUT:   %Sink_X.ref: %Sink_X.type = name_ref Sink_X, file.%Sink_X.decl [template = constants.%Sink_X]
 // CHECK:STDOUT:   %Source.ref.loc31: %Source.type = name_ref Source, file.%Source.decl [template = constants.%Source]
 // CHECK:STDOUT:   %int.make_type_32: init type = call constants.%Int32() [template = i32]
@@ -320,20 +317,17 @@ fn Test() {
 // CHECK:STDOUT:   %.loc31_16.2: type = converted %int.make_type_32, %.loc31_16.1 [template = i32]
 // CHECK:STDOUT:   %.loc31_10: <specific function> = specific_function %Source.ref.loc31, @Source(i32) [template = constants.%.17]
 // CHECK:STDOUT:   %Source.call.loc31: init i32 = call %.loc31_10()
-// CHECK:STDOUT:   %ImplicitAs.type.loc31: type = interface_type @ImplicitAs, @ImplicitAs(constants.%X) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc31_16.3: %.7 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%X) [template = constants.%.8]
-// CHECK:STDOUT:   %Convert.ref.loc31: %.7 = name_ref Convert, %.loc31_16.3 [template = constants.%.8]
-// CHECK:STDOUT:   %.loc31_16.4: ref i32 = temporary_storage
-// CHECK:STDOUT:   %.loc31_16.5: ref i32 = temporary %.loc31_16.4, %Source.call.loc31
-// CHECK:STDOUT:   %.loc31_16.6: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2]
-// CHECK:STDOUT:   %.loc31_16.7: <bound method> = bound_method %.loc31_16.5, %.loc31_16.6
-// CHECK:STDOUT:   %.loc31_16.8: ref %X = temporary_storage
-// CHECK:STDOUT:   %.loc31_16.9: i32 = bind_value %.loc31_16.5
-// CHECK:STDOUT:   %Convert.call.loc31: init %X = call %.loc31_16.7(%.loc31_16.9) to %.loc31_16.8
-// CHECK:STDOUT:   %.loc31_16.10: init %X = converted %Source.call.loc31, %Convert.call.loc31
-// CHECK:STDOUT:   %.loc31_16.11: ref %X = temporary %.loc31_16.8, %.loc31_16.10
-// CHECK:STDOUT:   %.loc31_16.12: %X = bind_value %.loc31_16.11
-// CHECK:STDOUT:   %Sink_X.call: init %.1 = call %Sink_X.ref(%.loc31_16.12)
+// CHECK:STDOUT:   %.loc31_16.3: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc31_16.4: ref i32 = temporary %.loc31_16.3, %Source.call.loc31
+// CHECK:STDOUT:   %.loc31_16.5: %Convert.type.3 = interface_witness_access constants.%.9, element0 [template = constants.%Convert.2]
+// CHECK:STDOUT:   %.loc31_16.6: <bound method> = bound_method %.loc31_16.4, %.loc31_16.5
+// CHECK:STDOUT:   %.loc31_16.7: ref %X = temporary_storage
+// CHECK:STDOUT:   %.loc31_16.8: i32 = bind_value %.loc31_16.4
+// CHECK:STDOUT:   %Convert.call.loc31: init %X = call %.loc31_16.6(%.loc31_16.8) to %.loc31_16.7
+// CHECK:STDOUT:   %.loc31_16.9: init %X = converted %Source.call.loc31, %Convert.call.loc31
+// CHECK:STDOUT:   %.loc31_16.10: ref %X = temporary %.loc31_16.7, %.loc31_16.9
+// CHECK:STDOUT:   %.loc31_16.11: %X = bind_value %.loc31_16.10
+// CHECK:STDOUT:   %Sink_X.call: init %.1 = call %Sink_X.ref(%.loc31_16.11)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 1
toolchain/check/testdata/operators/overloaded/inc.carbon

@@ -127,7 +127,6 @@ fn TestOp() {
 // CHECK:STDOUT:   %.loc22_16: init %C = converted %.loc22_15.1, %.loc22_15.2 [template = constants.%struct]
 // CHECK:STDOUT:   assign %c.var, %.loc22_16
 // CHECK:STDOUT:   %c.ref: ref %C = name_ref c, %c
-// CHECK:STDOUT:   %Op.ref: %.8 = name_ref Op, imports.%import_ref.3 [template = constants.%.9]
 // CHECK:STDOUT:   %.loc23_3.1: %Op.type.2 = interface_witness_access constants.%.6, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc23_3.2: <bound method> = bound_method %c.ref, %.loc23_3.1
 // CHECK:STDOUT:   %.loc23_5: %.3 = addr_of %c.ref

+ 18 - 30
toolchain/check/testdata/operators/overloaded/index.carbon

@@ -258,16 +258,13 @@ let x: i32 = c[0];
 // CHECK:STDOUT:   %c: %C = bind_name c, %.loc15_14.2
 // CHECK:STDOUT:   %c.ref: %C = name_ref c, %c
 // CHECK:STDOUT:   %s.ref: %SubscriptType.1 = name_ref s, %s
-// CHECK:STDOUT:   %IndexWith.type: type = interface_type @IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1) [template = constants.%IndexWith.type.3]
-// CHECK:STDOUT:   %.loc16_25.1: %.6 = specific_constant imports.%import_ref.3, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1) [template = constants.%.7]
-// CHECK:STDOUT:   %At.ref: %.6 = name_ref At, %.loc16_25.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc16_25.2: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
-// CHECK:STDOUT:   %.loc16_25.3: <bound method> = bound_method %c.ref, %.loc16_25.2
-// CHECK:STDOUT:   %.loc16_25.4: ref %ElementType.1 = temporary_storage
-// CHECK:STDOUT:   %At.call: init %ElementType.1 = call %.loc16_25.3(%c.ref, %s.ref) to %.loc16_25.4
-// CHECK:STDOUT:   %.loc16_25.5: ref %ElementType.1 = temporary %.loc16_25.4, %At.call
-// CHECK:STDOUT:   %.loc16_25.6: %ElementType.1 = bind_value %.loc16_25.5
-// CHECK:STDOUT:   %x: %ElementType.1 = bind_name x, %.loc16_25.6
+// CHECK:STDOUT:   %.loc16_25.1: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
+// CHECK:STDOUT:   %.loc16_25.2: <bound method> = bound_method %c.ref, %.loc16_25.1
+// CHECK:STDOUT:   %.loc16_25.3: ref %ElementType.1 = temporary_storage
+// CHECK:STDOUT:   %At.call: init %ElementType.1 = call %.loc16_25.2(%c.ref, %s.ref) to %.loc16_25.3
+// CHECK:STDOUT:   %.loc16_25.4: ref %ElementType.1 = temporary %.loc16_25.3, %At.call
+// CHECK:STDOUT:   %.loc16_25.5: %ElementType.1 = bind_value %.loc16_25.4
+// CHECK:STDOUT:   %x: %ElementType.1 = bind_name x, %.loc16_25.5
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -494,12 +491,9 @@ let x: i32 = c[0];
 // CHECK:STDOUT:   %s: %.3 = bind_name s, %.loc10_27
 // CHECK:STDOUT:   %s.ref: %.3 = name_ref s, %s
 // CHECK:STDOUT:   %.loc11_16: i32 = int_value 0 [template = constants.%.10]
-// CHECK:STDOUT:   %IndexWith.type: type = interface_type @IndexWith, @IndexWith(i32, i32) [template = constants.%IndexWith.type.3]
-// CHECK:STDOUT:   %.loc11_17.1: %.6 = specific_constant imports.%import_ref.4, @IndexWith(i32, i32) [template = constants.%.7]
-// CHECK:STDOUT:   %At.ref: %.6 = name_ref At, %.loc11_17.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc11_17.2: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
-// CHECK:STDOUT:   %.loc11_17.3: <bound method> = bound_method %s.ref, %.loc11_17.2
-// CHECK:STDOUT:   %At.call: init i32 = call %.loc11_17.3(%s.ref, %.loc11_16)
+// CHECK:STDOUT:   %.loc11_17.1: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
+// CHECK:STDOUT:   %.loc11_17.2: <bound method> = bound_method %s.ref, %.loc11_17.1
+// CHECK:STDOUT:   %At.call: init i32 = call %.loc11_17.2(%s.ref, %.loc11_16)
 // CHECK:STDOUT:   %.loc11_18.1: i32 = value_of_initializer %At.call
 // CHECK:STDOUT:   %.loc11_18.2: i32 = converted %At.call, %.loc11_18.1
 // CHECK:STDOUT:   %e: i32 = bind_name e, %.loc11_18.2
@@ -781,20 +775,14 @@ let x: i32 = c[0];
 // CHECK:STDOUT:   %c: %C = bind_name c, %.loc14_14.2
 // CHECK:STDOUT:   %c.ref: %C = name_ref c, %c
 // CHECK:STDOUT:   %.loc22_24: i32 = int_value 0 [template = constants.%.10]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SubscriptType.1) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc22_25.1: %.13 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%SubscriptType.1) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref: %.13 = name_ref Convert, %.loc22_25.1 [template = constants.%.14]
-// CHECK:STDOUT:   %.loc22_25.2: %SubscriptType.1 = converted %.loc22_24, <error> [template = <error>]
-// CHECK:STDOUT:   %IndexWith.type: type = interface_type @IndexWith, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1) [template = constants.%IndexWith.type.3]
-// CHECK:STDOUT:   %.loc22_25.3: %.6 = specific_constant imports.%import_ref.3, @IndexWith(constants.%SubscriptType.1, constants.%ElementType.1) [template = constants.%.7]
-// CHECK:STDOUT:   %At.ref: %.6 = name_ref At, %.loc22_25.3 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc22_25.4: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
-// CHECK:STDOUT:   %.loc22_25.5: <bound method> = bound_method %c.ref, %.loc22_25.4
-// CHECK:STDOUT:   %.loc22_25.6: ref %ElementType.1 = temporary_storage
-// CHECK:STDOUT:   %At.call: init %ElementType.1 = call %.loc22_25.5(%c.ref, <error>) to %.loc22_25.6
-// CHECK:STDOUT:   %.loc22_25.7: ref %ElementType.1 = temporary %.loc22_25.6, %At.call
-// CHECK:STDOUT:   %.loc22_25.8: %ElementType.1 = bind_value %.loc22_25.7
-// CHECK:STDOUT:   %x: %ElementType.1 = bind_name x, %.loc22_25.8
+// CHECK:STDOUT:   %.loc22_25.1: %SubscriptType.1 = converted %.loc22_24, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc22_25.2: %At.type.3 = interface_witness_access constants.%.8, element0 [template = constants.%At.2]
+// CHECK:STDOUT:   %.loc22_25.3: <bound method> = bound_method %c.ref, %.loc22_25.2
+// CHECK:STDOUT:   %.loc22_25.4: ref %ElementType.1 = temporary_storage
+// CHECK:STDOUT:   %At.call: init %ElementType.1 = call %.loc22_25.3(%c.ref, <error>) to %.loc22_25.4
+// CHECK:STDOUT:   %.loc22_25.5: ref %ElementType.1 = temporary %.loc22_25.4, %At.call
+// CHECK:STDOUT:   %.loc22_25.6: %ElementType.1 = bind_value %.loc22_25.5
+// CHECK:STDOUT:   %x: %ElementType.1 = bind_name x, %.loc22_25.6
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/operators/overloaded/left_shift.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 2
toolchain/check/testdata/operators/overloaded/mod.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 2
toolchain/check/testdata/operators/overloaded/mul.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 1
toolchain/check/testdata/operators/overloaded/negate.carbon

@@ -139,7 +139,6 @@ fn TestOp(a: C) -> C {
 // CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return: %C {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
-// CHECK:STDOUT:   %Op.ref: %.6 = name_ref Op, imports.%import_ref.3 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc24_10.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc24_10.2: <bound method> = bound_method %a.ref, %.loc24_10.1
 // CHECK:STDOUT:   %.loc23_17.2: ref %C = splice_block %return {}

+ 3 - 6
toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon

@@ -265,12 +265,9 @@ fn F() { ()[()]; }
 // CHECK:STDOUT:   %.loc15_11.2: %.1 = converted %.loc15_11.1, %tuple.loc15_11 [template = constants.%tuple]
 // CHECK:STDOUT:   %tuple.loc15_14: %.1 = tuple_value () [template = constants.%tuple]
 // CHECK:STDOUT:   %.loc15_15.1: %.1 = converted %.loc15_14, %tuple.loc15_14 [template = constants.%tuple]
-// CHECK:STDOUT:   %IndexWith.type: type = interface_type @IndexWith, @IndexWith(constants.%.1) [template = constants.%IndexWith.type.3]
-// CHECK:STDOUT:   %.loc15_15.2: %.4 = specific_constant @IndexWith.%.loc6_52.1, @IndexWith(constants.%.1) [template = constants.%.5]
-// CHECK:STDOUT:   %At.ref: %.4 = name_ref At, %.loc15_15.2 [template = constants.%.5]
-// CHECK:STDOUT:   %.loc15_15.3: %At.type.3 = interface_witness_access constants.%.6, element0 [template = constants.%At.2]
-// CHECK:STDOUT:   %.loc15_15.4: <bound method> = bound_method %.loc15_11.2, %.loc15_15.3 [template = constants.%.7]
-// CHECK:STDOUT:   %At.call: init %.1 = call %.loc15_15.4(%.loc15_11.2, %.loc15_15.1)
+// CHECK:STDOUT:   %.loc15_15.2: %At.type.3 = interface_witness_access constants.%.6, element0 [template = constants.%At.2]
+// CHECK:STDOUT:   %.loc15_15.3: <bound method> = bound_method %.loc15_11.2, %.loc15_15.2 [template = constants.%.7]
+// CHECK:STDOUT:   %At.call: init %.1 = call %.loc15_15.3(%.loc15_11.2, %.loc15_15.1)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 8
toolchain/check/testdata/operators/overloaded/ordered.carbon

@@ -389,7 +389,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Less.ref: %.6 = name_ref Less, imports.%import_ref.3 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc14_12.1: %Less.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Less.1]
 // CHECK:STDOUT:   %.loc14_12.2: <bound method> = bound_method %a.ref, %.loc14_12.1
 // CHECK:STDOUT:   %Less.call: init bool = call %.loc14_12.2(%a.ref, %b.ref)
@@ -402,7 +401,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %LessOrEquivalent.ref: %.8 = name_ref LessOrEquivalent, imports.%import_ref.4 [template = constants.%.9]
 // CHECK:STDOUT:   %.loc18_12.1: %LessOrEquivalent.type.2 = interface_witness_access constants.%.4, element1 [template = constants.%LessOrEquivalent.1]
 // CHECK:STDOUT:   %.loc18_12.2: <bound method> = bound_method %a.ref, %.loc18_12.1
 // CHECK:STDOUT:   %LessOrEquivalent.call: init bool = call %.loc18_12.2(%a.ref, %b.ref)
@@ -415,7 +413,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Greater.ref: %.10 = name_ref Greater, imports.%import_ref.5 [template = constants.%.11]
 // CHECK:STDOUT:   %.loc22_12.1: %Greater.type.2 = interface_witness_access constants.%.4, element2 [template = constants.%Greater.1]
 // CHECK:STDOUT:   %.loc22_12.2: <bound method> = bound_method %a.ref, %.loc22_12.1
 // CHECK:STDOUT:   %Greater.call: init bool = call %.loc22_12.2(%a.ref, %b.ref)
@@ -428,7 +425,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %GreaterOrEquivalent.ref: %.12 = name_ref GreaterOrEquivalent, imports.%import_ref.6 [template = constants.%.13]
 // CHECK:STDOUT:   %.loc26_12.1: %GreaterOrEquivalent.type.2 = interface_witness_access constants.%.4, element3 [template = constants.%GreaterOrEquivalent.1]
 // CHECK:STDOUT:   %.loc26_12.2: <bound method> = bound_method %a.ref, %.loc26_12.1
 // CHECK:STDOUT:   %GreaterOrEquivalent.call: init bool = call %.loc26_12.2(%a.ref, %b.ref)
@@ -647,7 +643,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Less.ref: %.5 = name_ref Less, imports.%import_ref.4 [template = constants.%.6]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -661,7 +656,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %LessOrEquivalent.ref: %.7 = name_ref LessOrEquivalent, imports.%import_ref.5 [template = constants.%.8]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -675,7 +669,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %Greater.ref: %.9 = name_ref Greater, imports.%import_ref.6 [template = constants.%.10]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -689,7 +682,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %D = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %D = name_ref b, %b
-// CHECK:STDOUT:   %GreaterOrEquivalent.ref: %.11 = name_ref GreaterOrEquivalent, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 0 - 2
toolchain/check/testdata/operators/overloaded/right_shift.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 0 - 2
toolchain/check/testdata/operators/overloaded/sub.carbon

@@ -238,7 +238,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %a.ref: %C = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.9 = name_ref Op, imports.%import_ref.3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc27_12.1: %Op.type.2 = interface_witness_access constants.%.4, element0 [template = constants.%Op.1]
 // CHECK:STDOUT:   %.loc27_12.2: <bound method> = bound_method %a.ref, %.loc27_12.1
 // CHECK:STDOUT:   %.loc26_23.2: ref %C = splice_block %return {}
@@ -251,7 +250,6 @@ fn TestAssign(a: C*, b: C) {
 // CHECK:STDOUT:   %a.ref: %.6 = name_ref a, %a
 // CHECK:STDOUT:   %.loc31_3.1: ref %C = deref %a.ref
 // CHECK:STDOUT:   %b.ref: %C = name_ref b, %b
-// CHECK:STDOUT:   %Op.ref: %.11 = name_ref Op, imports.%import_ref.7 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc31_6.1: %Op.type.4 = interface_witness_access constants.%.8, element0 [template = constants.%Op.3]
 // CHECK:STDOUT:   %.loc31_6.2: <bound method> = bound_method %.loc31_3.1, %.loc31_6.1
 // CHECK:STDOUT:   %.loc31_3.2: %.6 = addr_of %.loc31_3.1

+ 1 - 4
toolchain/check/testdata/pointer/fail_type_mismatch.carbon

@@ -112,10 +112,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
 // CHECK:STDOUT: fn @ConstMismatch(%p.param_patt: %.3) -> %.5 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: %.3 = name_ref p, %p
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.5) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_11.1: %.9 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.5) [template = constants.%.10]
-// CHECK:STDOUT:   %Convert.ref: %.9 = name_ref Convert, %.loc18_11.1 [template = constants.%.10]
-// CHECK:STDOUT:   %.loc18_11.2: %.5 = converted %p.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18: %.5 = converted %p.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 4
toolchain/check/testdata/return/fail_type_mismatch.carbon

@@ -105,10 +105,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT: fn @Main() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc18_10: f64 = float_literal 1 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_13.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc18_13.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc18_13.2: i32 = converted %.loc18_10, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_13: i32 = converted %.loc18_10, <error> [template = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 48 - 72
toolchain/check/testdata/return/no_prelude/import_convert_function.carbon

@@ -1075,16 +1075,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc8_24.3: init %C.3 = class_init (), %.loc8_24.2 [template = constants.%struct.1]
 // CHECK:STDOUT:   %.loc8_24.4: ref %C.3 = temporary %.loc8_24.2, %.loc8_24.3
 // CHECK:STDOUT:   %.loc8_26.1: ref %C.3 = converted %.loc8_24.1, %.loc8_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc8: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc8_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc8: %.12 = name_ref Convert, %.loc8_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc8_35.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.3]
-// CHECK:STDOUT:   %.loc8_35.3: <bound method> = bound_method %.loc8_26.1, %.loc8_35.2
-// CHECK:STDOUT:   %.loc8_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc8_35.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.3]
+// CHECK:STDOUT:   %.loc8_35.2: <bound method> = bound_method %.loc8_26.1, %.loc8_35.1
+// CHECK:STDOUT:   %.loc8_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc8_26.2: %C.3 = bind_value %.loc8_26.1
-// CHECK:STDOUT:   %Convert.call.loc8: init %D = call %.loc8_35.3(%.loc8_26.2) to %.loc8_35.4
-// CHECK:STDOUT:   %.loc8_35.5: init %D = converted %.loc8_26.1, %Convert.call.loc8
-// CHECK:STDOUT:   return %.loc8_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc8: init %D = call %.loc8_35.2(%.loc8_26.2) to %.loc8_35.3
+// CHECK:STDOUT:   %.loc8_35.4: init %D = converted %.loc8_26.1, %Convert.call.loc8
+// CHECK:STDOUT:   return %.loc8_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc8:
 // CHECK:STDOUT:   %.loc9_7: bool = bool_literal false [template = constants.%.5]
@@ -1100,16 +1097,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc9_24.3: init %C.4 = class_init (), %.loc9_24.2 [template = constants.%struct.2]
 // CHECK:STDOUT:   %.loc9_24.4: ref %C.4 = temporary %.loc9_24.2, %.loc9_24.3
 // CHECK:STDOUT:   %.loc9_26.1: ref %C.4 = converted %.loc9_24.1, %.loc9_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc9: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc9_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc9: %.12 = name_ref Convert, %.loc9_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc9_35.2: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.4]
-// CHECK:STDOUT:   %.loc9_35.3: <bound method> = bound_method %.loc9_26.1, %.loc9_35.2
-// CHECK:STDOUT:   %.loc9_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc9_35.1: %Convert.type.2 = interface_witness_access constants.%.23, element0 [template = constants.%Convert.4]
+// CHECK:STDOUT:   %.loc9_35.2: <bound method> = bound_method %.loc9_26.1, %.loc9_35.1
+// CHECK:STDOUT:   %.loc9_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc9_26.2: %C.4 = bind_value %.loc9_26.1
-// CHECK:STDOUT:   %Convert.call.loc9: init %D = call %.loc9_35.3(%.loc9_26.2) to %.loc9_35.4
-// CHECK:STDOUT:   %.loc9_35.5: init %D = converted %.loc9_26.1, %Convert.call.loc9
-// CHECK:STDOUT:   return %.loc9_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc9: init %D = call %.loc9_35.2(%.loc9_26.2) to %.loc9_35.3
+// CHECK:STDOUT:   %.loc9_35.4: init %D = converted %.loc9_26.1, %Convert.call.loc9
+// CHECK:STDOUT:   return %.loc9_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc9:
 // CHECK:STDOUT:   %.loc10_7: bool = bool_literal false [template = constants.%.5]
@@ -1125,16 +1119,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc10_24.3: init %C.5 = class_init (), %.loc10_24.2 [template = constants.%struct.3]
 // CHECK:STDOUT:   %.loc10_24.4: ref %C.5 = temporary %.loc10_24.2, %.loc10_24.3
 // CHECK:STDOUT:   %.loc10_26.1: ref %C.5 = converted %.loc10_24.1, %.loc10_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc10: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc10_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc10: %.12 = name_ref Convert, %.loc10_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc10_35.2: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.5]
-// CHECK:STDOUT:   %.loc10_35.3: <bound method> = bound_method %.loc10_26.1, %.loc10_35.2
-// CHECK:STDOUT:   %.loc10_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc10_35.1: %Convert.type.2 = interface_witness_access constants.%.24, element0 [template = constants.%Convert.5]
+// CHECK:STDOUT:   %.loc10_35.2: <bound method> = bound_method %.loc10_26.1, %.loc10_35.1
+// CHECK:STDOUT:   %.loc10_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc10_26.2: %C.5 = bind_value %.loc10_26.1
-// CHECK:STDOUT:   %Convert.call.loc10: init %D = call %.loc10_35.3(%.loc10_26.2) to %.loc10_35.4
-// CHECK:STDOUT:   %.loc10_35.5: init %D = converted %.loc10_26.1, %Convert.call.loc10
-// CHECK:STDOUT:   return %.loc10_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc10: init %D = call %.loc10_35.2(%.loc10_26.2) to %.loc10_35.3
+// CHECK:STDOUT:   %.loc10_35.4: init %D = converted %.loc10_26.1, %Convert.call.loc10
+// CHECK:STDOUT:   return %.loc10_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc10:
 // CHECK:STDOUT:   %.loc11_7: bool = bool_literal false [template = constants.%.5]
@@ -1150,16 +1141,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc11_24.3: init %C.6 = class_init (), %.loc11_24.2 [template = constants.%struct.4]
 // CHECK:STDOUT:   %.loc11_24.4: ref %C.6 = temporary %.loc11_24.2, %.loc11_24.3
 // CHECK:STDOUT:   %.loc11_26.1: ref %C.6 = converted %.loc11_24.1, %.loc11_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc11: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc11_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc11: %.12 = name_ref Convert, %.loc11_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc11_35.2: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.6]
-// CHECK:STDOUT:   %.loc11_35.3: <bound method> = bound_method %.loc11_26.1, %.loc11_35.2
-// CHECK:STDOUT:   %.loc11_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc11_35.1: %Convert.type.2 = interface_witness_access constants.%.25, element0 [template = constants.%Convert.6]
+// CHECK:STDOUT:   %.loc11_35.2: <bound method> = bound_method %.loc11_26.1, %.loc11_35.1
+// CHECK:STDOUT:   %.loc11_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc11_26.2: %C.6 = bind_value %.loc11_26.1
-// CHECK:STDOUT:   %Convert.call.loc11: init %D = call %.loc11_35.3(%.loc11_26.2) to %.loc11_35.4
-// CHECK:STDOUT:   %.loc11_35.5: init %D = converted %.loc11_26.1, %Convert.call.loc11
-// CHECK:STDOUT:   return %.loc11_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc11: init %D = call %.loc11_35.2(%.loc11_26.2) to %.loc11_35.3
+// CHECK:STDOUT:   %.loc11_35.4: init %D = converted %.loc11_26.1, %Convert.call.loc11
+// CHECK:STDOUT:   return %.loc11_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc11:
 // CHECK:STDOUT:   %.loc12_7: bool = bool_literal false [template = constants.%.5]
@@ -1175,16 +1163,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc12_24.3: init %C.7 = class_init (), %.loc12_24.2 [template = constants.%struct.5]
 // CHECK:STDOUT:   %.loc12_24.4: ref %C.7 = temporary %.loc12_24.2, %.loc12_24.3
 // CHECK:STDOUT:   %.loc12_26.1: ref %C.7 = converted %.loc12_24.1, %.loc12_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc12: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc12_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc12: %.12 = name_ref Convert, %.loc12_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc12_35.2: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.7]
-// CHECK:STDOUT:   %.loc12_35.3: <bound method> = bound_method %.loc12_26.1, %.loc12_35.2
-// CHECK:STDOUT:   %.loc12_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc12_35.1: %Convert.type.2 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.7]
+// CHECK:STDOUT:   %.loc12_35.2: <bound method> = bound_method %.loc12_26.1, %.loc12_35.1
+// CHECK:STDOUT:   %.loc12_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc12_26.2: %C.7 = bind_value %.loc12_26.1
-// CHECK:STDOUT:   %Convert.call.loc12: init %D = call %.loc12_35.3(%.loc12_26.2) to %.loc12_35.4
-// CHECK:STDOUT:   %.loc12_35.5: init %D = converted %.loc12_26.1, %Convert.call.loc12
-// CHECK:STDOUT:   return %.loc12_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc12: init %D = call %.loc12_35.2(%.loc12_26.2) to %.loc12_35.3
+// CHECK:STDOUT:   %.loc12_35.4: init %D = converted %.loc12_26.1, %Convert.call.loc12
+// CHECK:STDOUT:   return %.loc12_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc12:
 // CHECK:STDOUT:   %.loc13_7: bool = bool_literal false [template = constants.%.5]
@@ -1200,16 +1185,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc13_24.3: init %C.8 = class_init (), %.loc13_24.2 [template = constants.%struct.6]
 // CHECK:STDOUT:   %.loc13_24.4: ref %C.8 = temporary %.loc13_24.2, %.loc13_24.3
 // CHECK:STDOUT:   %.loc13_26.1: ref %C.8 = converted %.loc13_24.1, %.loc13_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc13: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc13_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc13: %.12 = name_ref Convert, %.loc13_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc13_35.2: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.8]
-// CHECK:STDOUT:   %.loc13_35.3: <bound method> = bound_method %.loc13_26.1, %.loc13_35.2
-// CHECK:STDOUT:   %.loc13_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc13_35.1: %Convert.type.2 = interface_witness_access constants.%.27, element0 [template = constants.%Convert.8]
+// CHECK:STDOUT:   %.loc13_35.2: <bound method> = bound_method %.loc13_26.1, %.loc13_35.1
+// CHECK:STDOUT:   %.loc13_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc13_26.2: %C.8 = bind_value %.loc13_26.1
-// CHECK:STDOUT:   %Convert.call.loc13: init %D = call %.loc13_35.3(%.loc13_26.2) to %.loc13_35.4
-// CHECK:STDOUT:   %.loc13_35.5: init %D = converted %.loc13_26.1, %Convert.call.loc13
-// CHECK:STDOUT:   return %.loc13_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc13: init %D = call %.loc13_35.2(%.loc13_26.2) to %.loc13_35.3
+// CHECK:STDOUT:   %.loc13_35.4: init %D = converted %.loc13_26.1, %Convert.call.loc13
+// CHECK:STDOUT:   return %.loc13_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc13:
 // CHECK:STDOUT:   %.loc14_7: bool = bool_literal false [template = constants.%.5]
@@ -1225,16 +1207,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc14_24.3: init %C.9 = class_init (), %.loc14_24.2 [template = constants.%struct.7]
 // CHECK:STDOUT:   %.loc14_24.4: ref %C.9 = temporary %.loc14_24.2, %.loc14_24.3
 // CHECK:STDOUT:   %.loc14_26.1: ref %C.9 = converted %.loc14_24.1, %.loc14_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc14: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc14_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc14: %.12 = name_ref Convert, %.loc14_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc14_35.2: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.9]
-// CHECK:STDOUT:   %.loc14_35.3: <bound method> = bound_method %.loc14_26.1, %.loc14_35.2
-// CHECK:STDOUT:   %.loc14_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc14_35.1: %Convert.type.2 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.9]
+// CHECK:STDOUT:   %.loc14_35.2: <bound method> = bound_method %.loc14_26.1, %.loc14_35.1
+// CHECK:STDOUT:   %.loc14_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc14_26.2: %C.9 = bind_value %.loc14_26.1
-// CHECK:STDOUT:   %Convert.call.loc14: init %D = call %.loc14_35.3(%.loc14_26.2) to %.loc14_35.4
-// CHECK:STDOUT:   %.loc14_35.5: init %D = converted %.loc14_26.1, %Convert.call.loc14
-// CHECK:STDOUT:   return %.loc14_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc14: init %D = call %.loc14_35.2(%.loc14_26.2) to %.loc14_35.3
+// CHECK:STDOUT:   %.loc14_35.4: init %D = converted %.loc14_26.1, %Convert.call.loc14
+// CHECK:STDOUT:   return %.loc14_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc14:
 // CHECK:STDOUT:   %.loc15_7: bool = bool_literal false [template = constants.%.5]
@@ -1250,16 +1229,13 @@ fn F0(n: i32) -> P.D {
 // CHECK:STDOUT:   %.loc15_24.3: init %C.10 = class_init (), %.loc15_24.2 [template = constants.%struct.8]
 // CHECK:STDOUT:   %.loc15_24.4: ref %C.10 = temporary %.loc15_24.2, %.loc15_24.3
 // CHECK:STDOUT:   %.loc15_26.1: ref %C.10 = converted %.loc15_24.1, %.loc15_24.4
-// CHECK:STDOUT:   %ImplicitAs.type.loc15: type = interface_type @ImplicitAs, @ImplicitAs(constants.%D) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc15_35.1: %.12 = specific_constant imports.%import_ref.10, @ImplicitAs(constants.%D) [template = constants.%.13]
-// CHECK:STDOUT:   %Convert.ref.loc15: %.12 = name_ref Convert, %.loc15_35.1 [template = constants.%.13]
-// CHECK:STDOUT:   %.loc15_35.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.10]
-// CHECK:STDOUT:   %.loc15_35.3: <bound method> = bound_method %.loc15_26.1, %.loc15_35.2
-// CHECK:STDOUT:   %.loc15_35.4: ref %D = temporary_storage
+// CHECK:STDOUT:   %.loc15_35.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.10]
+// CHECK:STDOUT:   %.loc15_35.2: <bound method> = bound_method %.loc15_26.1, %.loc15_35.1
+// CHECK:STDOUT:   %.loc15_35.3: ref %D = temporary_storage
 // CHECK:STDOUT:   %.loc15_26.2: %C.10 = bind_value %.loc15_26.1
-// CHECK:STDOUT:   %Convert.call.loc15: init %D = call %.loc15_35.3(%.loc15_26.2) to %.loc15_35.4
-// CHECK:STDOUT:   %.loc15_35.5: init %D = converted %.loc15_26.1, %Convert.call.loc15
-// CHECK:STDOUT:   return %.loc15_35.5 to %return
+// CHECK:STDOUT:   %Convert.call.loc15: init %D = call %.loc15_35.2(%.loc15_26.2) to %.loc15_35.3
+// CHECK:STDOUT:   %.loc15_35.4: init %D = converted %.loc15_26.1, %Convert.call.loc15
+// CHECK:STDOUT:   return %.loc15_35.4 to %return
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else.loc15:
 // CHECK:STDOUT:   %P.ref.loc16: <namespace> = name_ref P, imports.%P [template = imports.%P]

+ 1 - 4
toolchain/check/testdata/struct/fail_type_assign.carbon

@@ -108,10 +108,7 @@ var x: {.a: i32} = {.a: i32};
 // CHECK:STDOUT:   %.loc17_25.1: type = value_of_initializer %int.make_type_32 [template = i32]
 // CHECK:STDOUT:   %.loc17_25.2: type = converted %int.make_type_32, %.loc17_25.1 [template = i32]
 // CHECK:STDOUT:   %.loc17_28: type = struct_type {.a: i32} [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.2) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_29.1: %.5 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%.2) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc17_29.1 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc17_29.2: %.2 = converted %.loc17_28, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_29: %.2 = converted %.loc17_28, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 5
toolchain/check/testdata/struct/fail_value_as_type.carbon

@@ -64,12 +64,9 @@ var x: {.a = 1};
 // CHECK:STDOUT:   %Core.import = import Core
 // CHECK:STDOUT:   %.loc17_14: i32 = int_value 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc17_15.1: %.2 = struct_literal (%.loc17_14)
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_15.2: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc17_15.2 [template = constants.%.7]
 // CHECK:STDOUT:   %struct: %.2 = struct_value (%.loc17_14) [template = constants.%struct]
-// CHECK:STDOUT:   %.loc17_15.3: %.2 = converted %.loc17_15.1, %struct [template = constants.%struct]
-// CHECK:STDOUT:   %.loc17_15.4: type = converted %.loc17_15.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_15.2: %.2 = converted %.loc17_15.1, %struct [template = constants.%struct]
+// CHECK:STDOUT:   %.loc17_15.3: type = converted %.loc17_15.1, <error> [template = <error>]
 // CHECK:STDOUT:   %x.var: ref <error> = var x
 // CHECK:STDOUT:   %x: ref <error> = bind_name x, %x.var
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/struct/import.carbon

@@ -594,11 +594,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
 // CHECK:STDOUT:   %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F]
 // CHECK:STDOUT:   %.loc9_35.1: ref %C.4 = temporary_storage
 // CHECK:STDOUT:   %F.call: init %C.4 = call %F.ref() to %.loc9_35.1
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc9_37.1: %.13 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref: %.13 = name_ref Convert, %.loc9_37.1 [template = constants.%.14]
 // CHECK:STDOUT:   %.loc9_35.2: ref %C.4 = temporary %.loc9_35.1, %F.call
-// CHECK:STDOUT:   %.loc9_37.2: %C.3 = converted %F.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc9_37: %C.3 = converted %F.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%c_bad.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 0 - 1
toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon

@@ -103,7 +103,6 @@ var b: i32 = a.(-10);
 // CHECK:STDOUT:   assign file.%a.var, %.loc11_28
 // CHECK:STDOUT:   %a.ref: ref %.3 = name_ref a, file.%a
 // CHECK:STDOUT:   %.loc15: i32 = int_value 10 [template = constants.%.7]
-// CHECK:STDOUT:   %Op.ref: %.8 = name_ref Op, imports.%import_ref.4 [template = constants.%.9]
 // CHECK:STDOUT:   assign file.%b.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon

@@ -133,10 +133,7 @@ var b: i32 = a.(2.6);
 // CHECK:STDOUT:   assign file.%a.var, %.loc11_28
 // CHECK:STDOUT:   %a.ref: ref %.3 = name_ref a, file.%a
 // CHECK:STDOUT:   %.loc18_17.1: f64 = float_literal 2.6000000000000001 [template = constants.%.7]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_17.2: %.10 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.11]
-// CHECK:STDOUT:   %Convert.ref: %.10 = name_ref Convert, %.loc18_17.2 [template = constants.%.11]
-// CHECK:STDOUT:   %.loc18_17.3: i32 = converted %.loc18_17.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_17.2: i32 = converted %.loc18_17.1, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%b.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon

@@ -118,10 +118,7 @@ var x: (i32, i32) = (2, 65.89);
 // CHECK:STDOUT:   %.loc17_30.1: %.7 = tuple_literal (%.loc17_22, %.loc17_25)
 // CHECK:STDOUT:   %.loc17_30.2: ref i32 = tuple_access file.%x.var, element0
 // CHECK:STDOUT:   %.loc17_30.3: init i32 = initialize_from %.loc17_22 to %.loc17_30.2 [template = constants.%.5]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_30.4: %.10 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.11]
-// CHECK:STDOUT:   %Convert.ref: %.10 = name_ref Convert, %.loc17_30.4 [template = constants.%.11]
-// CHECK:STDOUT:   %.loc17_30.5: i32 = converted %.loc17_25, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_30.4: i32 = converted %.loc17_25, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/tuple/fail_type_assign.carbon

@@ -108,12 +108,9 @@ var x: (i32, ) = (i32, );
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %int.make_type_32: init type = call constants.%Int32() [template = i32]
 // CHECK:STDOUT:   %.loc17_24.1: %.2 = tuple_literal (%int.make_type_32)
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(i32) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_24.2: %.6 = specific_constant imports.%import_ref.4, @ImplicitAs(i32) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc17_24.2 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc17_19.1: ref type = temporary_storage
 // CHECK:STDOUT:   %.loc17_19.2: ref type = temporary %.loc17_19.1, %int.make_type_32
-// CHECK:STDOUT:   %.loc17_24.3: i32 = converted %int.make_type_32, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_24.2: i32 = converted %int.make_type_32, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/tuple/fail_value_as_type.carbon

@@ -63,10 +63,7 @@ var x: (1, );
 // CHECK:STDOUT:   %Core.import = import Core
 // CHECK:STDOUT:   %.loc17_9: i32 = int_value 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc17_12.1: %.2 = tuple_literal (%.loc17_9)
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc17_12.2: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc17_12.2 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc17_12.3: type = converted %.loc17_9, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc17_12.2: type = converted %.loc17_9, <error> [template = <error>]
 // CHECK:STDOUT:   %x.var: ref <error> = var x
 // CHECK:STDOUT:   %x: ref <error> = bind_name x, %x.var
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/tuple/import.carbon

@@ -635,11 +635,8 @@ var c_bad: C((3, 4)) = F();
 // CHECK:STDOUT:   %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F]
 // CHECK:STDOUT:   %.loc10_25.1: ref %C.4 = temporary_storage
 // CHECK:STDOUT:   %F.call: init %C.4 = call %F.ref() to %.loc10_25.1
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%C.3) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc10_27.1: %.13 = specific_constant imports.%import_ref.8, @ImplicitAs(constants.%C.3) [template = constants.%.14]
-// CHECK:STDOUT:   %Convert.ref: %.13 = name_ref Convert, %.loc10_27.1 [template = constants.%.14]
 // CHECK:STDOUT:   %.loc10_25.2: ref %C.4 = temporary %.loc10_25.1, %F.call
-// CHECK:STDOUT:   %.loc10_27.2: %C.3 = converted %F.call, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc10_27: %C.3 = converted %F.call, <error> [template = <error>]
 // CHECK:STDOUT:   assign file.%c_bad.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/var/fail_storage_is_literal.carbon

@@ -90,10 +90,7 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc18_10.1: i32 = int_value 1 [template = constants.%.2]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_10.2: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:   %Convert.ref: %.5 = name_ref Convert, %.loc18_10.2 [template = constants.%.6]
-// CHECK:STDOUT:   %.loc18_10.3: type = converted %.loc18_10.1, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_10.2: type = converted %.loc18_10.1, <error> [template = <error>]
 // CHECK:STDOUT:   %x.var: ref <error> = var x
 // CHECK:STDOUT:   %x: ref <error> = bind_name x, %x.var
 // CHECK:STDOUT:   %.loc18_14: i32 = int_value 1 [template = constants.%.2]

+ 8 - 29
toolchain/check/testdata/where_expr/constraints.carbon

@@ -394,12 +394,9 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT:     %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %P.ref: %.1 = name_ref P, @N.%.loc5 [template = constants.%.2]
 // CHECK:STDOUT:     %.loc15_28.1: %.4 = struct_literal ()
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.1) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc15_28.2: %.7 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.1) [template = constants.%.8]
-// CHECK:STDOUT:     %Convert.ref: %.7 = name_ref Convert, %.loc15_28.2 [template = constants.%.8]
 // CHECK:STDOUT:     %struct: %.4 = struct_value () [template = constants.%struct]
-// CHECK:STDOUT:     %.loc15_28.3: %.4 = converted %.loc15_28.1, %struct [template = constants.%struct]
-// CHECK:STDOUT:     %.loc15_28.4: %.1 = converted %.loc15_28.1, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc15_28.2: %.4 = converted %.loc15_28.1, %struct [template = constants.%struct]
+// CHECK:STDOUT:     %.loc15_28.3: %.1 = converted %.loc15_28.1, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc15_16: type = where_expr %.Self [template = constants.%.10] {
 // CHECK:STDOUT:       requirement_rewrite %P.ref, <error>
 // CHECK:STDOUT:     }
@@ -565,10 +562,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT:     %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %Associated.ref: %.2 = name_ref Associated, @K.%.loc8 [template = constants.%.3]
 // CHECK:STDOUT:     %M.ref: type = name_ref M, file.%M.decl [template = constants.%M.type]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc18_36.1: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.7]
-// CHECK:STDOUT:     %Convert.ref: %.6 = name_ref Convert, %.loc18_36.1 [template = constants.%.7]
-// CHECK:STDOUT:     %.loc18_36.2: type = converted %Associated.ref, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc18_36: type = converted %Associated.ref, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc18_30: type = where_expr %.Self [template = constants.%.9] {
 // CHECK:STDOUT:       requirement_impls <error>, %M.ref
 // CHECK:STDOUT:     }
@@ -759,10 +753,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT:     %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %Member.ref: %.2 = name_ref Member, imports.%import_ref.7 [template = constants.%.3]
 // CHECK:STDOUT:     %.loc16_46.1: i32 = int_value 2 [template = constants.%.4]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.2) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc16_46.2: %.7 = specific_constant imports.%import_ref.14, @ImplicitAs(constants.%.2) [template = constants.%.8]
-// CHECK:STDOUT:     %Convert.ref: %.7 = name_ref Convert, %.loc16_46.2 [template = constants.%.8]
-// CHECK:STDOUT:     %.loc16_46.3: %.2 = converted %.loc16_46.1, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc16_46.2: %.2 = converted %.loc16_46.1, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc16_30: type = where_expr %.Self [template = constants.%.10] {
 // CHECK:STDOUT:       requirement_rewrite %Member.ref, <error>
 // CHECK:STDOUT:     }
@@ -909,10 +900,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT:   } {
 // CHECK:STDOUT:     %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %.loc11_32.1: i32 = int_value 7 [template = constants.%.1]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc11_32.2: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:     %Convert.ref: %.5 = name_ref Convert, %.loc11_32.2 [template = constants.%.6]
-// CHECK:STDOUT:     %.loc11_32.3: type = converted %.loc11_32.1, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc11_32.2: type = converted %.loc11_32.1, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc11_26: type = where_expr %.Self [template = constants.%.8] {
 // CHECK:STDOUT:       requirement_impls <error>, type
 // CHECK:STDOUT:     }
@@ -1052,10 +1040,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT:     %.Self: type = bind_symbolic_name .Self, 0 [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %.Self.ref: type = name_ref .Self, %.Self [symbolic = constants.%.Self]
 // CHECK:STDOUT:     %.loc11_44.1: i32 = int_value 7 [template = constants.%.1]
-// CHECK:STDOUT:     %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:     %.loc11_44.2: %.5 = specific_constant imports.%import_ref.3, @ImplicitAs(type) [template = constants.%.6]
-// CHECK:STDOUT:     %Convert.ref: %.5 = name_ref Convert, %.loc11_44.2 [template = constants.%.6]
-// CHECK:STDOUT:     %.loc11_44.3: type = converted %.loc11_44.1, <error> [template = <error>]
+// CHECK:STDOUT:     %.loc11_44.2: type = converted %.loc11_44.1, <error> [template = <error>]
 // CHECK:STDOUT:     %.loc11_26: type = where_expr %.Self [template = constants.%.8] {
 // CHECK:STDOUT:       requirement_impls %.Self.ref, <error>
 // CHECK:STDOUT:     }
@@ -1364,10 +1349,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %EmptyStruct.ref: %EmptyStruct.type = name_ref EmptyStruct, file.%EmptyStruct.decl [template = constants.%EmptyStruct]
 // CHECK:STDOUT:   %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.5) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc32_14.1: %.8 = specific_constant imports.%import_ref.9, @ImplicitAs(constants.%.5) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref: %.8 = name_ref Convert, %.loc32_14.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc32_14.2: %.5 = converted %C.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc32: %.5 = converted %C.ref, <error> [template = <error>]
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -1543,10 +1525,7 @@ let B: type where .Self impls A = D;
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %D.ref: type = name_ref D, file.%D.decl [template = constants.%D]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%.5) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc14_36.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%.5) [template = constants.%.9]
-// CHECK:STDOUT:   %Convert.ref: %.8 = name_ref Convert, %.loc14_36.1 [template = constants.%.9]
-// CHECK:STDOUT:   %.loc14_36.2: %.5 = converted %D.ref, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc14: %.5 = converted %D.ref, <error> [template = <error>]
 // CHECK:STDOUT:   %B: %.5 = bind_name B, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 4
toolchain/check/testdata/while/fail_bad_condition.carbon

@@ -94,10 +94,7 @@ fn While() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: !while.cond:
 // CHECK:STDOUT:   %.loc18_10: String = string_literal "Hello" [template = constants.%.3]
-// CHECK:STDOUT:   %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(bool) [template = constants.%ImplicitAs.type.3]
-// CHECK:STDOUT:   %.loc18_17.1: %.6 = specific_constant imports.%import_ref.3, @ImplicitAs(bool) [template = constants.%.7]
-// CHECK:STDOUT:   %Convert.ref: %.6 = name_ref Convert, %.loc18_17.1 [template = constants.%.7]
-// CHECK:STDOUT:   %.loc18_17.2: bool = converted %.loc18_10, <error> [template = <error>]
+// CHECK:STDOUT:   %.loc18_17: bool = converted %.loc18_10, <error> [template = <error>]
 // CHECK:STDOUT:   if <error> br !while.body else br !while.done
 // CHECK:STDOUT:
 // CHECK:STDOUT: !while.body:

+ 22 - 3
toolchain/sem_ir/ids.h

@@ -870,13 +870,17 @@ struct ImportIRInstId : public IdBase, public Printable<ImportIRInstId> {
 
 constexpr ImportIRInstId ImportIRInstId::Invalid = ImportIRInstId(InvalidIndex);
 
-// A SemIR location used exclusively for diagnostic locations.
+// A SemIR location used as the location of instructions.
 //
 // Contents:
 // - index > Invalid: A Parse::NodeId in the current IR.
 // - index < Invalid: An ImportIRInstId.
 // - index == Invalid: Can be used for either.
 struct LocId : public IdBase, public Printable<LocId> {
+  // This bit, if set for a node ID location, indicates a location for
+  // operations performed implicitly.
+  static const int32_t ImplicitBit = 1 << 30;
+
   // An explicitly invalid ID.
   static const LocId Invalid;
 
@@ -888,22 +892,37 @@ struct LocId : public IdBase, public Printable<LocId> {
   // NOLINTNEXTLINE(google-explicit-constructor)
   constexpr LocId(Parse::NodeId node_id) : IdBase(node_id.index) {
     CARBON_CHECK(node_id.is_valid() == is_valid());
+    CARBON_CHECK(!is_implicit());
   }
 
   // NOLINTNEXTLINE(google-explicit-constructor)
   constexpr LocId(ImportIRInstId inst_id)
       : IdBase(InvalidIndex + ImportIRInstId::InvalidIndex - inst_id.index) {
     CARBON_CHECK(inst_id.is_valid() == is_valid());
+    CARBON_CHECK(index & ImplicitBit);
+  }
+
+  // Forms an equivalent LocId for an implicit location.
+  auto ToImplicit() const -> LocId {
+    // For import IR locations and the invalid location, the implicit bit is
+    // always set, so this is a no-op.
+    return LocId(index | ImplicitBit);
   }
 
   auto is_node_id() const -> bool { return index > InvalidIndex; }
   auto is_import_ir_inst_id() const -> bool { return index < InvalidIndex; }
+  auto is_implicit() const -> bool {
+    return is_node_id() && (index & ImplicitBit) != 0;
+  }
 
   // This is allowed to return an invalid NodeId, but should never be used for a
   // valid InstId.
   auto node_id() const -> Parse::NodeId {
-    CARBON_CHECK(is_node_id() || !is_valid());
-    return Parse::NodeId(index);
+    if (!is_valid()) {
+      return Parse::NodeId::Invalid;
+    }
+    CARBON_CHECK(is_node_id());
+    return Parse::NodeId(index & ~ImplicitBit);
   }
 
   // This is allowed to return an invalid InstId, but should never be used for a