Bladeren bron

Remove parse nodes from constants. (#3599)

These instructions are intended to be shared across all uses and so
don't have a meaningful location. So far, only type constants are
shared.
Richard Smith 2 jaren geleden
bovenliggende
commit
d712bf12a6
100 gewijzigde bestanden met toevoegingen van 752 en 784 verwijderingen
  1. 47 62
      toolchain/check/context.cpp
  2. 5 10
      toolchain/check/context.h
  3. 4 5
      toolchain/check/convert.cpp
  4. 10 19
      toolchain/check/eval.cpp
  5. 1 1
      toolchain/check/handle_call_expr.cpp
  6. 2 3
      toolchain/check/handle_class.cpp
  7. 1 1
      toolchain/check/handle_function.cpp
  8. 3 4
      toolchain/check/handle_operator.cpp
  9. 1 1
      toolchain/check/handle_paren.cpp
  10. 1 1
      toolchain/check/handle_struct.cpp
  11. 11 11
      toolchain/check/testdata/array/array_in_place.carbon
  12. 12 12
      toolchain/check/testdata/array/assign_return_value.carbon
  13. 15 15
      toolchain/check/testdata/array/assign_var.carbon
  14. 26 26
      toolchain/check/testdata/array/base.carbon
  15. 4 4
      toolchain/check/testdata/array/fail_bound_overflow.carbon
  16. 7 7
      toolchain/check/testdata/array/fail_incomplete_element.carbon
  17. 7 7
      toolchain/check/testdata/array/fail_invalid_type.carbon
  18. 12 12
      toolchain/check/testdata/array/fail_out_of_bound.carbon
  19. 40 40
      toolchain/check/testdata/array/fail_type_mismatch.carbon
  20. 16 16
      toolchain/check/testdata/array/function_param.carbon
  21. 24 24
      toolchain/check/testdata/array/nine_elements.carbon
  22. 5 5
      toolchain/check/testdata/as/as_type.carbon
  23. 2 2
      toolchain/check/testdata/as/basic.carbon
  24. 8 8
      toolchain/check/testdata/as/fail_no_conversion.carbon
  25. 4 4
      toolchain/check/testdata/as/fail_not_type.carbon
  26. 3 3
      toolchain/check/testdata/as/identity.carbon
  27. 14 14
      toolchain/check/testdata/as/tuple.carbon
  28. 7 7
      toolchain/check/testdata/basics/builtin_types.carbon
  29. 1 1
      toolchain/check/testdata/basics/fail_bad_run.carbon
  30. 2 2
      toolchain/check/testdata/basics/fail_non_type_as_type.carbon
  31. 36 36
      toolchain/check/testdata/basics/numeric_literals.carbon
  32. 4 4
      toolchain/check/testdata/basics/parens.carbon
  33. 7 7
      toolchain/check/testdata/basics/raw_and_textual_ir.carbon
  34. 2 2
      toolchain/check/testdata/basics/run_i32.carbon
  35. 7 7
      toolchain/check/testdata/basics/textual_ir.carbon
  36. 14 14
      toolchain/check/testdata/class/base.carbon
  37. 11 11
      toolchain/check/testdata/class/base_field.carbon
  38. 4 4
      toolchain/check/testdata/class/base_function_unqualified.carbon
  39. 10 10
      toolchain/check/testdata/class/base_method.carbon
  40. 11 11
      toolchain/check/testdata/class/base_method_shadow.carbon
  41. 7 7
      toolchain/check/testdata/class/basic.carbon
  42. 34 34
      toolchain/check/testdata/class/derived_to_base.carbon
  43. 14 14
      toolchain/check/testdata/class/fail_abstract.carbon
  44. 1 1
      toolchain/check/testdata/class/fail_addr_not_self.carbon
  45. 3 3
      toolchain/check/testdata/class/fail_addr_self.carbon
  46. 29 29
      toolchain/check/testdata/class/fail_base_bad_type.carbon
  47. 4 4
      toolchain/check/testdata/class/fail_base_method_define.carbon
  48. 1 1
      toolchain/check/testdata/class/fail_base_misplaced.carbon
  49. 4 4
      toolchain/check/testdata/class/fail_base_modifiers.carbon
  50. 4 4
      toolchain/check/testdata/class/fail_base_no_extend.carbon
  51. 4 4
      toolchain/check/testdata/class/fail_base_repeated.carbon
  52. 4 4
      toolchain/check/testdata/class/fail_base_unbound.carbon
  53. 6 6
      toolchain/check/testdata/class/fail_derived_to_base.carbon
  54. 5 5
      toolchain/check/testdata/class/fail_field_modifiers.carbon
  55. 2 2
      toolchain/check/testdata/class/fail_incomplete.carbon
  56. 17 17
      toolchain/check/testdata/class/fail_init.carbon
  57. 7 7
      toolchain/check/testdata/class/fail_init_as_inplace.carbon
  58. 6 6
      toolchain/check/testdata/class/fail_memaccess_category.carbon
  59. 1 1
      toolchain/check/testdata/class/fail_member_of_let.carbon
  60. 3 3
      toolchain/check/testdata/class/fail_method.carbon
  61. 1 1
      toolchain/check/testdata/class/fail_method_modifiers.carbon
  62. 1 1
      toolchain/check/testdata/class/fail_modifiers.carbon
  63. 1 1
      toolchain/check/testdata/class/fail_out_of_line_decl.carbon
  64. 1 1
      toolchain/check/testdata/class/fail_redeclaration_introducer.carbon
  65. 1 1
      toolchain/check/testdata/class/fail_redeclaration_scope.carbon
  66. 1 1
      toolchain/check/testdata/class/fail_redefinition.carbon
  67. 3 3
      toolchain/check/testdata/class/fail_reorder.carbon
  68. 3 3
      toolchain/check/testdata/class/fail_scope.carbon
  69. 3 3
      toolchain/check/testdata/class/fail_self.carbon
  70. 2 2
      toolchain/check/testdata/class/fail_todo_modifiers.carbon
  71. 1 1
      toolchain/check/testdata/class/fail_unbound_field.carbon
  72. 2 2
      toolchain/check/testdata/class/fail_unknown_member.carbon
  73. 6 6
      toolchain/check/testdata/class/field_access.carbon
  74. 6 6
      toolchain/check/testdata/class/field_access_in_value.carbon
  75. 3 3
      toolchain/check/testdata/class/init.carbon
  76. 6 6
      toolchain/check/testdata/class/init_as.carbon
  77. 6 6
      toolchain/check/testdata/class/init_nested.carbon
  78. 32 32
      toolchain/check/testdata/class/method.carbon
  79. 4 4
      toolchain/check/testdata/class/nested.carbon
  80. 5 5
      toolchain/check/testdata/class/nested_name.carbon
  81. 5 5
      toolchain/check/testdata/class/raw_self.carbon
  82. 1 1
      toolchain/check/testdata/class/raw_self_type.carbon
  83. 1 1
      toolchain/check/testdata/class/redeclaration.carbon
  84. 1 1
      toolchain/check/testdata/class/redeclaration_introducer.carbon
  85. 5 5
      toolchain/check/testdata/class/reenter_scope.carbon
  86. 9 9
      toolchain/check/testdata/class/scope.carbon
  87. 2 2
      toolchain/check/testdata/class/self.carbon
  88. 19 19
      toolchain/check/testdata/class/self_conversion.carbon
  89. 6 6
      toolchain/check/testdata/class/self_type.carbon
  90. 7 7
      toolchain/check/testdata/class/static_method.carbon
  91. 7 7
      toolchain/check/testdata/expr_category/in_place_tuple_init.carbon
  92. 5 5
      toolchain/check/testdata/function/call/empty_struct.carbon
  93. 4 4
      toolchain/check/testdata/function/call/empty_tuple.carbon
  94. 2 2
      toolchain/check/testdata/function/call/fail_not_callable.carbon
  95. 13 13
      toolchain/check/testdata/function/call/fail_param_count.carbon
  96. 3 3
      toolchain/check/testdata/function/call/fail_param_type.carbon
  97. 2 2
      toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon
  98. 2 2
      toolchain/check/testdata/function/call/i32.carbon
  99. 10 10
      toolchain/check/testdata/function/call/more_param_ir.carbon
  100. 3 3
      toolchain/check/testdata/function/call/params_one.carbon

+ 47 - 62
toolchain/check/context.cpp

@@ -77,17 +77,18 @@ auto Context::AddInst(SemIR::ParseNodeAndInst parse_node_and_inst)
   return inst_id;
 }
 
-auto Context::AddConstant(SemIR::ParseNodeAndInst parse_node_and_inst,
-                          bool is_symbolic) -> SemIR::ConstantId {
+auto Context::AddConstant(SemIR::Inst inst, bool is_symbolic)
+    -> SemIR::ConstantId {
   // TODO: Deduplicate constants.
-  auto inst_id = insts().AddInNoBlock(parse_node_and_inst);
+  auto inst_id = insts().AddInNoBlock(
+      SemIR::ParseNodeAndInst::Untyped(Parse::NodeId::Invalid, inst));
   constants().Add(inst_id);
 
   auto const_id = is_symbolic ? SemIR::ConstantId::ForSymbolicConstant(inst_id)
                               : SemIR::ConstantId::ForTemplateConstant(inst_id);
   constant_values().Set(inst_id, const_id);
 
-  CARBON_VLOG() << "AddConstantInst: " << parse_node_and_inst.inst << "\n";
+  CARBON_VLOG() << "AddConstantInst: " << inst << "\n";
   return const_id;
 }
 
@@ -651,8 +652,7 @@ class TypeCompleter {
         break;
 
       case Phase::BuildValueRepr: {
-        auto value_rep = BuildValueRepr(
-            type_id, context_.insts().GetParseNode(inst_id), inst);
+        auto value_rep = BuildValueRepr(type_id, inst);
         context_.sem_ir().CompleteType(type_id, value_rep);
         CARBON_CHECK(old_work_list_size == work_list_.size())
             << "BuildValueRepr should not change work items";
@@ -731,9 +731,9 @@ class TypeCompleter {
 
   // Makes an empty value representation, which is used for types that have no
   // state, such as empty structs and tuples.
-  auto MakeEmptyValueRepr(Parse::NodeId parse_node) const -> SemIR::ValueRepr {
+  auto MakeEmptyValueRepr() const -> SemIR::ValueRepr {
     return {.kind = SemIR::ValueRepr::None,
-            .type_id = context_.CanonicalizeTupleType(parse_node, {})};
+            .type_id = context_.CanonicalizeTupleType({})};
   }
 
   // Makes a value representation that uses pass-by-copy, copying the given
@@ -749,14 +749,14 @@ class TypeCompleter {
 
   // Makes a value representation that uses pass-by-address with the given
   // pointee type.
-  auto MakePointerValueRepr(Parse::NodeId parse_node, SemIR::TypeId pointee_id,
+  auto MakePointerValueRepr(SemIR::TypeId pointee_id,
                             SemIR::ValueRepr::AggregateKind aggregate_kind =
                                 SemIR::ValueRepr::NotAggregate) const
       -> SemIR::ValueRepr {
     // TODO: Should we add `const` qualification to `pointee_id`?
     return {.kind = SemIR::ValueRepr::Pointer,
             .aggregate_kind = aggregate_kind,
-            .type_id = context_.GetPointerType(parse_node, pointee_id)};
+            .type_id = context_.GetPointerType(pointee_id)};
   }
 
   // Gets the value representation of a nested type, which should already be
@@ -800,13 +800,12 @@ class TypeCompleter {
         // TODO: Decide on string value semantics. This should probably be a
         // custom value representation carrying a pointer and size or
         // similar.
-        return MakePointerValueRepr(Parse::NodeId::Invalid, type_id);
+        return MakePointerValueRepr(type_id);
     }
     llvm_unreachable("All builtin kinds were handled above");
   }
 
-  auto BuildStructOrTupleValueRepr(Parse::NodeId parse_node,
-                                   std::size_t num_elements,
+  auto BuildStructOrTupleValueRepr(std::size_t num_elements,
                                    SemIR::TypeId elementwise_rep,
                                    bool same_as_object_rep) const
       -> SemIR::ValueRepr {
@@ -824,16 +823,16 @@ class TypeCompleter {
     }
     // For a struct or tuple with multiple fields, we use a pointer
     // to the elementwise value representation.
-    return MakePointerValueRepr(parse_node, elementwise_rep, aggregate_kind);
+    return MakePointerValueRepr(elementwise_rep, aggregate_kind);
   }
 
-  auto BuildStructTypeValueRepr(SemIR::TypeId type_id, Parse::NodeId parse_node,
+  auto BuildStructTypeValueRepr(SemIR::TypeId type_id,
                                 SemIR::StructType struct_type) const
       -> SemIR::ValueRepr {
     // TODO: Share more code with tuples.
     auto fields = context_.inst_blocks().Get(struct_type.fields_id);
     if (fields.empty()) {
-      return MakeEmptyValueRepr(parse_node);
+      return MakeEmptyValueRepr();
     }
 
     // Find the value representation for each field, and construct a struct
@@ -848,34 +847,31 @@ class TypeCompleter {
         same_as_object_rep = false;
         field.field_type_id = field_value_rep.type_id;
         // TODO: Use `TryEvalInst` to form this value.
-        field_id =
-            context_
-                .AddConstant(
-                    {context_.insts().GetParseNode(field_id), field},
-                    context_.constant_values()
-                        .Get(context_.types().GetInstId(field.field_type_id))
-                        .is_symbolic())
-                .inst_id();
+        field_id = context_
+                       .AddConstant(field, context_.constant_values()
+                                               .Get(context_.types().GetInstId(
+                                                   field.field_type_id))
+                                               .is_symbolic())
+                       .inst_id();
       }
       value_rep_fields.push_back(field_id);
     }
 
-    auto value_rep =
-        same_as_object_rep
-            ? type_id
-            : context_.CanonicalizeStructType(
-                  parse_node, context_.inst_blocks().Add(value_rep_fields));
-    return BuildStructOrTupleValueRepr(parse_node, fields.size(), value_rep,
+    auto value_rep = same_as_object_rep
+                         ? type_id
+                         : context_.CanonicalizeStructType(
+                               context_.inst_blocks().Add(value_rep_fields));
+    return BuildStructOrTupleValueRepr(fields.size(), value_rep,
                                        same_as_object_rep);
   }
 
-  auto BuildTupleTypeValueRepr(SemIR::TypeId type_id, Parse::NodeId parse_node,
+  auto BuildTupleTypeValueRepr(SemIR::TypeId type_id,
                                SemIR::TupleType tuple_type) const
       -> SemIR::ValueRepr {
     // TODO: Share more code with structs.
     auto elements = context_.type_blocks().Get(tuple_type.elements_id);
     if (elements.empty()) {
-      return MakeEmptyValueRepr(parse_node);
+      return MakeEmptyValueRepr();
     }
 
     // Find the value representation for each element, and construct a tuple
@@ -891,17 +887,17 @@ class TypeCompleter {
       value_rep_elements.push_back(element_value_rep.type_id);
     }
 
-    auto value_rep = same_as_object_rep ? type_id
-                                        : context_.CanonicalizeTupleType(
-                                              parse_node, value_rep_elements);
-    return BuildStructOrTupleValueRepr(parse_node, elements.size(), value_rep,
+    auto value_rep = same_as_object_rep
+                         ? type_id
+                         : context_.CanonicalizeTupleType(value_rep_elements);
+    return BuildStructOrTupleValueRepr(elements.size(), value_rep,
                                        same_as_object_rep);
   }
 
   // Builds and returns the value representation for the given type. All nested
   // types, as found by AddNestedIncompleteTypes, are known to be complete.
-  auto BuildValueRepr(SemIR::TypeId type_id, Parse::NodeId parse_node,
-                      SemIR::Inst inst) const -> SemIR::ValueRepr {
+  auto BuildValueRepr(SemIR::TypeId type_id, SemIR::Inst inst) const
+      -> SemIR::ValueRepr {
     // TODO: This can emit new SemIR instructions. Consider emitting them into a
     // dedicated file-scope instruction block where possible, or somewhere else
     // that better reflects the definition of the type, rather than wherever the
@@ -970,17 +966,14 @@ class TypeCompleter {
         // For arrays, it's convenient to always use a pointer representation,
         // even when the array has zero or one element, in order to support
         // indexing.
-        return MakePointerValueRepr(parse_node, type_id,
-                                    SemIR::ValueRepr::ObjectAggregate);
+        return MakePointerValueRepr(type_id, SemIR::ValueRepr::ObjectAggregate);
       }
 
       case SemIR::StructType::Kind:
-        return BuildStructTypeValueRepr(type_id, parse_node,
-                                        inst.As<SemIR::StructType>());
+        return BuildStructTypeValueRepr(type_id, inst.As<SemIR::StructType>());
 
       case SemIR::TupleType::Kind:
-        return BuildTupleTypeValueRepr(type_id, parse_node,
-                                       inst.As<SemIR::TupleType>());
+        return BuildTupleTypeValueRepr(type_id, inst.As<SemIR::TupleType>());
 
       case SemIR::ClassType::Kind:
         // The value representation for a class is a pointer to the object
@@ -988,7 +981,6 @@ class TypeCompleter {
         // TODO: Support customized value representations for classes.
         // TODO: Pick a better value representation when possible.
         return MakePointerValueRepr(
-            parse_node,
             context_.classes()
                 .Get(inst.As<SemIR::ClassType>().class_id)
                 .object_repr_id,
@@ -1155,17 +1147,14 @@ static auto ProfileType(Context& semantics_context, SemIR::Inst inst,
   return true;
 }
 
-auto Context::CanonicalizeTypeAndAddInstIfNew(Parse::NodeId parse_node,
-                                              SemIR::Inst inst)
+auto Context::CanonicalizeTypeAndAddInstIfNew(SemIR::Inst inst)
     -> SemIR::TypeId {
   auto profile_node = [&](llvm::FoldingSetNodeID& canonical_id) {
     return ProfileType(*this, inst, canonical_id);
   };
   auto make_inst = [&] {
     // TODO: Properly determine whether types are symbolic.
-    return AddConstant(SemIR::ParseNodeAndInst::Untyped(parse_node, inst),
-                       /*is_symbolic=*/false)
-        .inst_id();
+    return AddConstant(inst, /*is_symbolic=*/false).inst_id();
   };
   return CanonicalizeTypeImpl(inst.kind(), profile_node, make_inst);
 }
@@ -1189,15 +1178,13 @@ auto Context::CanonicalizeType(SemIR::InstId inst_id) -> SemIR::TypeId {
   return CanonicalizeTypeImpl(inst.kind(), profile_node, make_inst);
 }
 
-auto Context::CanonicalizeStructType(Parse::NodeId parse_node,
-                                     SemIR::InstBlockId refs_id)
+auto Context::CanonicalizeStructType(SemIR::InstBlockId refs_id)
     -> SemIR::TypeId {
   return CanonicalizeTypeAndAddInstIfNew(
-      parse_node, SemIR::StructType{SemIR::TypeId::TypeType, refs_id});
+      SemIR::StructType{SemIR::TypeId::TypeType, refs_id});
 }
 
-auto Context::CanonicalizeTupleType(Parse::NodeId parse_node,
-                                    llvm::ArrayRef<SemIR::TypeId> type_ids)
+auto Context::CanonicalizeTupleType(llvm::ArrayRef<SemIR::TypeId> type_ids)
     -> SemIR::TypeId {
   // Defer allocating a SemIR::TypeBlockId until we know this is a new type.
   auto profile_tuple = [&](llvm::FoldingSetNodeID& canonical_id) {
@@ -1206,10 +1193,9 @@ auto Context::CanonicalizeTupleType(Parse::NodeId parse_node,
   };
   auto make_tuple_inst = [&] {
     // TODO: Properly determine when types are symbolic.
-    return AddConstant(
-               {parse_node, SemIR::TupleType{SemIR::TypeId::TypeType,
-                                             type_blocks().Add(type_ids)}},
-               /*is_symbolic=*/false)
+    return AddConstant(SemIR::TupleType{SemIR::TypeId::TypeType,
+                                        type_blocks().Add(type_ids)},
+                       /*is_symbolic=*/false)
         .inst_id();
   };
   return CanonicalizeTypeImpl(SemIR::TupleType::Kind, profile_tuple,
@@ -1225,10 +1211,9 @@ auto Context::GetBuiltinType(SemIR::BuiltinKind kind) -> SemIR::TypeId {
   return type_id;
 }
 
-auto Context::GetPointerType(Parse::NodeId parse_node,
-                             SemIR::TypeId pointee_type_id) -> SemIR::TypeId {
+auto Context::GetPointerType(SemIR::TypeId pointee_type_id) -> SemIR::TypeId {
   return CanonicalizeTypeAndAddInstIfNew(
-      parse_node, SemIR::PointerType{SemIR::TypeId::TypeType, pointee_type_id});
+      SemIR::PointerType{SemIR::TypeId::TypeType, pointee_type_id});
 }
 
 auto Context::GetUnqualifiedType(SemIR::TypeId type_id) -> SemIR::TypeId {

+ 5 - 10
toolchain/check/context.h

@@ -82,8 +82,7 @@ class Context {
   auto AddInst(SemIR::ParseNodeAndInst parse_node_and_inst) -> SemIR::InstId;
 
   // Adds an instruction to the constants block, returning the produced ID.
-  auto AddConstant(SemIR::ParseNodeAndInst parse_node_and_inst,
-                   bool is_symbolic) -> SemIR::ConstantId;
+  auto AddConstant(SemIR::Inst inst, bool is_symbolic) -> SemIR::ConstantId;
 
   // Pushes a parse tree node onto the stack, storing the SemIR::Inst as the
   // result.
@@ -258,13 +257,11 @@ class Context {
   // Individual struct type fields aren't canonicalized because they may have
   // name conflicts or other diagnostics during creation, which can use the
   // parse node.
-  auto CanonicalizeStructType(Parse::NodeId parse_node,
-                              SemIR::InstBlockId refs_id) -> SemIR::TypeId;
+  auto CanonicalizeStructType(SemIR::InstBlockId refs_id) -> SemIR::TypeId;
 
   // Handles canonicalization of tuple types. This may create a new tuple type
   // if the `type_ids` doesn't match an existing tuple type.
-  auto CanonicalizeTupleType(Parse::NodeId parse_node,
-                             llvm::ArrayRef<SemIR::TypeId> type_ids)
+  auto CanonicalizeTupleType(llvm::ArrayRef<SemIR::TypeId> type_ids)
       -> SemIR::TypeId;
 
   // Attempts to complete the type `type_id`. Returns `true` if the type is
@@ -293,8 +290,7 @@ class Context {
   auto GetBuiltinType(SemIR::BuiltinKind kind) -> SemIR::TypeId;
 
   // Returns a pointer type whose pointee type is `pointee_type_id`.
-  auto GetPointerType(Parse::NodeId parse_node, SemIR::TypeId pointee_type_id)
-      -> SemIR::TypeId;
+  auto GetPointerType(SemIR::TypeId pointee_type_id) -> SemIR::TypeId;
 
   // Removes any top-level `const` qualifiers from a type.
   auto GetUnqualifiedType(SemIR::TypeId type_id) -> SemIR::TypeId;
@@ -480,8 +476,7 @@ class Context {
 
   // Forms a canonical type ID for a type. If the type is new, adds the
   // instruction to the current block.
-  auto CanonicalizeTypeAndAddInstIfNew(Parse::NodeId parse_node,
-                                       SemIR::Inst inst) -> SemIR::TypeId;
+  auto CanonicalizeTypeAndAddInstIfNew(SemIR::Inst inst) -> SemIR::TypeId;
 
   // If the passed in instruction ID is a LazyImportRef, resolves it for use.
   // Called when name lookup intends to return an inst_id.

+ 4 - 5
toolchain/check/convert.cpp

@@ -820,7 +820,7 @@ static auto PerformBuiltinConversion(Context& context, Parse::NodeId parse_node,
         // iterative approach.
         type_ids.push_back(ExprAsType(context, parse_node, tuple_inst_id));
       }
-      auto tuple_type_id = context.CanonicalizeTupleType(parse_node, type_ids);
+      auto tuple_type_id = context.CanonicalizeTupleType(type_ids);
       return sem_ir.types().GetInstId(tuple_type_id);
     }
 
@@ -942,7 +942,7 @@ auto Convert(Context& context, Parse::NodeId parse_node, SemIR::InstId expr_id,
   // Track that we performed a type conversion, if we did so.
   if (orig_expr_id != expr_id) {
     expr_id = context.AddInst(
-        {context.insts().GetParseNode(expr_id),
+        {context.insts().GetParseNode(orig_expr_id),
          SemIR::Converted{target.type_id, orig_expr_id, expr_id}});
   }
 
@@ -1120,9 +1120,8 @@ static auto ConvertSelf(Context& context, Parse::NodeId call_parse_node,
     }
     auto parse_node = context.insts().GetParseNode(self_or_addr_id);
     self_or_addr_id = context.AddInst(
-        {parse_node,
-         SemIR::AddrOf{context.GetPointerType(parse_node, self.type_id()),
-                       self_or_addr_id}});
+        {parse_node, SemIR::AddrOf{context.GetPointerType(self.type_id()),
+                                   self_or_addr_id}});
   }
 
   return ConvertToValueOfType(context, call_parse_node, self_or_addr_id,

+ 10 - 19
toolchain/check/eval.cpp

@@ -66,8 +66,7 @@ static auto ReplaceFieldWithConstantValue(Context& context, InstT* inst,
 // replaces the fields with their constant values and builds a corresponding
 // constant value. Otherwise returns `SemIR::InstId::Invalid`.
 template <typename InstT, typename... EachFieldIdT>
-static auto RebuildIfFieldsAreConstant(Context& context, SemIR::InstId inst_id,
-                                       SemIR::Inst inst,
+static auto RebuildIfFieldsAreConstant(Context& context, SemIR::Inst inst,
                                        EachFieldIdT InstT::*... each_field_id)
     -> SemIR::ConstantId {
   // Build a constant instruction by replacing each non-constant operand with
@@ -77,10 +76,7 @@ static auto RebuildIfFieldsAreConstant(Context& context, SemIR::InstId inst_id,
   if ((ReplaceFieldWithConstantValue(context, &typed_inst, each_field_id,
                                      &is_symbolic) &&
        ...)) {
-    return context.AddConstant(
-        SemIR::ParseNodeAndInst::Untyped(context.insts().GetParseNode(inst_id),
-                                         typed_inst),
-        is_symbolic);
+    return context.AddConstant(typed_inst, is_symbolic);
   }
   return SemIR::ConstantId::NotConstant;
 }
@@ -95,23 +91,23 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
   switch (inst.kind()) {
     // These cases are constants if their operands are.
     case SemIR::AddrOf::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::AddrOf::lvalue_id);
     case SemIR::ArrayType::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::ArrayType::bound_id);
     case SemIR::BoundMethod::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::BoundMethod::object_id,
                                         &SemIR::BoundMethod::function_id);
     case SemIR::StructValue::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::StructValue::elements_id);
     case SemIR::Temporary::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::Temporary::init_id);
     case SemIR::TupleValue::Kind:
-      return RebuildIfFieldsAreConstant(context, inst_id, inst,
+      return RebuildIfFieldsAreConstant(context, inst,
                                         &SemIR::TupleValue::elements_id);
 
     // These cases are constants already.
@@ -137,10 +133,7 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
     case SemIR::RealLiteral::Kind:
     case SemIR::StringLiteral::Kind:
       // Promote literals to the constant block.
-      return context.AddConstant(
-          SemIR::ParseNodeAndInst::Untyped(
-              context.insts().GetParseNode(inst_id), inst),
-          /*is_symbolic=*/false);
+      return context.AddConstant(inst, /*is_symbolic=*/false);
 
     // TODO: These need special handling.
     case SemIR::ArrayIndex::Kind:
@@ -194,9 +187,7 @@ auto TryEvalInst(Context& context, SemIR::InstId inst_id, SemIR::Inst inst)
       value.value =
           (value.value == SemIR::BoolValue::False ? SemIR::BoolValue::True
                                                   : SemIR::BoolValue::False);
-      return context.AddConstant(
-          {context.insts().GetParseNode(const_id.inst_id()), value},
-          /*is_symbolic=*/false);
+      return context.AddConstant(value, /*is_symbolic=*/false);
     }
 
     // These cases are either not expressions or not constant.

+ 1 - 1
toolchain/check/handle_call_expr.cpp

@@ -73,7 +73,7 @@ auto HandleCallExpr(Context& context, Parse::CallExprId parse_node) -> bool {
   // tuple type.
   SemIR::TypeId type_id = callable.return_type_id;
   if (!type_id.is_valid()) {
-    type_id = context.CanonicalizeTupleType(call_expr_parse_node, {});
+    type_id = context.CanonicalizeTupleType({});
   }
 
   // If there is a return slot, build storage for the result.

+ 2 - 3
toolchain/check/handle_class.cpp

@@ -327,7 +327,7 @@ auto HandleBaseDecl(Context& context, Parse::BaseDeclId parse_node) -> bool {
 }
 
 auto HandleClassDefinition(Context& context,
-                           Parse::ClassDefinitionId parse_node) -> bool {
+                           Parse::ClassDefinitionId /*parse_node*/) -> bool {
   auto fields_id = context.args_type_info_stack().Pop();
   auto class_id =
       context.node_stack().Pop<Parse::NodeKind::ClassDefinitionStart>();
@@ -337,8 +337,7 @@ auto HandleClassDefinition(Context& context,
 
   // The class type is now fully defined.
   auto& class_info = context.classes().Get(class_id);
-  class_info.object_repr_id =
-      context.CanonicalizeStructType(parse_node, fields_id);
+  class_info.object_repr_id = context.CanonicalizeStructType(fields_id);
   return true;
 }
 

+ 1 - 1
toolchain/check/handle_function.cpp

@@ -189,7 +189,7 @@ static auto BuildFunctionDecl(Context& context,
         (return_slot_id.is_valid() &&
          return_type_id !=
              context.GetBuiltinType(SemIR::BuiltinKind::BoolType) &&
-         return_type_id != context.CanonicalizeTupleType(parse_node, {}))) {
+         return_type_id != context.CanonicalizeTupleType({}))) {
       CARBON_DIAGNOSTIC(InvalidMainRunSignature, Error,
                         "Invalid signature for `Main.Run` function. Expected "
                         "`fn ()` or `fn () -> i32`.");

+ 3 - 4
toolchain/check/handle_operator.cpp

@@ -223,10 +223,9 @@ auto HandlePrefixOperatorAmp(Context& context,
       break;
   }
   context.AddInstAndPush(
-      {parse_node,
-       SemIR::AddrOf{context.GetPointerType(
-                         parse_node, context.insts().Get(value_id).type_id()),
-                     value_id}});
+      {parse_node, SemIR::AddrOf{context.GetPointerType(
+                                     context.insts().Get(value_id).type_id()),
+                                 value_id}});
   return true;
 }
 

+ 1 - 1
toolchain/check/handle_paren.cpp

@@ -43,7 +43,7 @@ auto HandleTupleLiteral(Context& context, Parse::TupleLiteralId parse_node)
   for (auto inst : inst_block) {
     type_ids.push_back(context.insts().Get(inst).type_id());
   }
-  auto type_id = context.CanonicalizeTupleType(parse_node, type_ids);
+  auto type_id = context.CanonicalizeTupleType(type_ids);
 
   auto value_id =
       context.AddInst({parse_node, SemIR::TupleLiteral{type_id, refs_id}});

+ 1 - 1
toolchain/check/handle_struct.cpp

@@ -104,7 +104,7 @@ auto HandleStructLiteral(Context& context, Parse::StructLiteralId parse_node)
     return true;
   }
 
-  auto type_id = context.CanonicalizeStructType(parse_node, type_block_id);
+  auto type_id = context.CanonicalizeStructType(type_block_id);
 
   auto value_id =
       context.AddInst({parse_node, SemIR::StructLiteral{type_id, refs_id}});

+ 11 - 11
toolchain/check/testdata/array/array_in_place.carbon

@@ -13,13 +13,13 @@ fn G() {
 // CHECK:STDOUT: --- array_in_place.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_25.1: type = tuple_type (type, type, type) [template]
-// CHECK:STDOUT:   %.loc7_25.2: type = tuple_type (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc7_25.3: type = ptr_type (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc10_28: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc10_29.1: type = array_type %.loc10_28, (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc10_29.2: type = ptr_type [(i32, i32, i32); 2] [template]
-// CHECK:STDOUT:   %.loc10_42: type = tuple_type ((i32, i32, i32), (i32, i32, i32)) [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.5: type = array_type %.4, (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.6: type = ptr_type [(i32, i32, i32); 2] [template]
+// CHECK:STDOUT:   %.7: type = tuple_type ((i32, i32, i32), (i32, i32, i32)) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -32,10 +32,10 @@ fn G() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @G() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10_25: (type, type, type) = tuple_literal (i32, i32, i32)
-// CHECK:STDOUT:   %.loc10_28: i32 = int_literal 2 [template = constants.%.loc10_28]
-// CHECK:STDOUT:   %.loc7: type = converted %.loc10_25, constants.%.loc7_25.2 [template = constants.%.loc7_25.2]
-// CHECK:STDOUT:   %.loc10_29: type = array_type %.loc10_28, (i32, i32, i32) [template = constants.%.loc10_29.1]
+// CHECK:STDOUT:   %.loc10_25.1: (type, type, type) = tuple_literal (i32, i32, i32)
+// CHECK:STDOUT:   %.loc10_28: i32 = int_literal 2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_25.2: type = converted %.loc10_25.1, constants.%.2 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc10_29: type = array_type %.loc10_28, (i32, i32, i32) [template = constants.%.5]
 // CHECK:STDOUT:   %v.var: ref [(i32, i32, i32); 2] = var v
 // CHECK:STDOUT:   %v: ref [(i32, i32, i32); 2] = bind_name v, %v.var
 // CHECK:STDOUT:   %F.ref.loc10_34: <function> = name_ref F, file.%F [template = file.%F]

+ 12 - 12
toolchain/check/testdata/array/assign_return_value.carbon

@@ -13,13 +13,13 @@ fn Run() {
 // CHECK:STDOUT: --- assign_return_value.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_16.1: type = tuple_type (type) [template]
-// CHECK:STDOUT:   %.loc7_16.2: type = tuple_type (i32) [template]
-// CHECK:STDOUT:   %.loc7_28: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc7_30: (i32,) = tuple_value (%.loc7_28) [template]
-// CHECK:STDOUT:   %.loc10_16: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_17.1: type = array_type %.loc10_16, i32 [template]
-// CHECK:STDOUT:   %.loc10_17.2: type = ptr_type [i32; 1] [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32) [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.4: (i32,) = tuple_value (%.3) [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.6: type = array_type %.5, i32 [template]
+// CHECK:STDOUT:   %.7: type = ptr_type [i32; 1] [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -30,17 +30,17 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> (i32,) {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7_28: i32 = int_literal 0 [template = constants.%.loc7_28]
+// CHECK:STDOUT:   %.loc7_28: i32 = int_literal 0 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc7_30.1: (i32,) = tuple_literal (%.loc7_28)
-// CHECK:STDOUT:   %.loc7_30.2: (i32,) = tuple_value (%.loc7_28) [template = constants.%.loc7_30]
-// CHECK:STDOUT:   %.loc7_30.3: (i32,) = converted %.loc7_30.1, %.loc7_30.2 [template = constants.%.loc7_30]
+// CHECK:STDOUT:   %.loc7_30.2: (i32,) = tuple_value (%.loc7_28) [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_30.3: (i32,) = converted %.loc7_30.1, %.loc7_30.2 [template = constants.%.4]
 // CHECK:STDOUT:   return %.loc7_30.3
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Run() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10_16: i32 = int_literal 1 [template = constants.%.loc10_16]
-// CHECK:STDOUT:   %.loc10_17: type = array_type %.loc10_16, i32 [template = constants.%.loc10_17.1]
+// CHECK:STDOUT:   %.loc10_16: i32 = int_literal 1 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc10_17: type = array_type %.loc10_16, i32 [template = constants.%.6]
 // CHECK:STDOUT:   %t.var: ref [i32; 1] = var t
 // CHECK:STDOUT:   %t: ref [i32; 1] = bind_name t, %t.var
 // CHECK:STDOUT:   %F.ref: <function> = name_ref F, file.%F [template = file.%F]

+ 15 - 15
toolchain/check/testdata/array/assign_var.carbon

@@ -10,26 +10,26 @@ var b: [i32; 3] = a;
 // CHECK:STDOUT: --- assign_var.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_22.1: type = tuple_type (type, type, type) [template]
-// CHECK:STDOUT:   %.loc7_22.2: type = tuple_type (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc7_22.3: type = ptr_type (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc7_27: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc7_30: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc7_33: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc8_15.1: type = array_type %.loc8_14, i32 [template]
-// CHECK:STDOUT:   %.loc8_15.2: type = ptr_type [i32; 3] [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.8: type = array_type %.7, i32 [template]
+// CHECK:STDOUT:   %.9: type = ptr_type [i32; 3] [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a, .b = %b}
 // CHECK:STDOUT:   %.loc7_22.1: (type, type, type) = tuple_literal (i32, i32, i32)
-// CHECK:STDOUT:   %.loc7_22.2: type = converted %.loc7_22.1, constants.%.loc7_22.2 [template = constants.%.loc7_22.2]
+// CHECK:STDOUT:   %.loc7_22.2: type = converted %.loc7_22.1, constants.%.2 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref (i32, i32, i32) = var a
 // CHECK:STDOUT:   %a: ref (i32, i32, i32) = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc7_27: i32 = int_literal 1 [template = constants.%.loc7_27]
-// CHECK:STDOUT:   %.loc7_30: i32 = int_literal 2 [template = constants.%.loc7_30]
-// CHECK:STDOUT:   %.loc7_33: i32 = int_literal 3 [template = constants.%.loc7_33]
+// CHECK:STDOUT:   %.loc7_27: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_30: i32 = int_literal 2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc7_33: i32 = int_literal 3 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc7_34.1: (i32, i32, i32) = tuple_literal (%.loc7_27, %.loc7_30, %.loc7_33)
 // CHECK:STDOUT:   %.loc7_34.2: ref i32 = tuple_access %a.var, element0
 // CHECK:STDOUT:   %.loc7_34.3: init i32 = initialize_from %.loc7_27 to %.loc7_34.2
@@ -40,8 +40,8 @@ var b: [i32; 3] = a;
 // CHECK:STDOUT:   %.loc7_34.8: init (i32, i32, i32) = tuple_init (%.loc7_34.3, %.loc7_34.5, %.loc7_34.7) to %a.var
 // CHECK:STDOUT:   %.loc7_34.9: init (i32, i32, i32) = converted %.loc7_34.1, %.loc7_34.8
 // CHECK:STDOUT:   assign %a.var, %.loc7_34.9
-// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 3 [template = constants.%.loc8_14]
-// CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, i32 [template = constants.%.loc8_15.1]
+// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 3 [template = constants.%.7]
+// CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, i32 [template = constants.%.8]
 // CHECK:STDOUT:   %b.var: ref [i32; 3] = var b
 // CHECK:STDOUT:   %b: ref [i32; 3] = bind_name b, %b.var
 // CHECK:STDOUT:   %a.ref: ref (i32, i32, i32) = name_ref a, %a

+ 26 - 26
toolchain/check/testdata/array/base.carbon

@@ -11,31 +11,31 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT: --- base.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc7_15.1: type = array_type %.loc7_14, i32 [template]
-// CHECK:STDOUT:   %.loc7_15.2: type = ptr_type [i32; 1] [template]
-// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc7_22: type = tuple_type (i32) [template]
-// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc8_15.1: type = array_type %.loc8_14, f64 [template]
-// CHECK:STDOUT:   %.loc8_15.2: type = ptr_type [f64; 2] [template]
-// CHECK:STDOUT:   %.loc8_20: f64 = real_literal 111e-1 [template]
-// CHECK:STDOUT:   %.loc8_26: f64 = real_literal 22e-1 [template]
-// CHECK:STDOUT:   %.loc8_30: type = tuple_type (f64, f64) [template]
-// CHECK:STDOUT:   %.loc9_10: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc9_13: i32 = int_literal 5 [template]
-// CHECK:STDOUT:   %.loc9_14.1: type = array_type %.loc9_13, () [template]
-// CHECK:STDOUT:   %.loc9_14.2: type = ptr_type [(); 5] [template]
-// CHECK:STDOUT:   %.loc9_38: type = tuple_type ((), (), (), (), ()) [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 1] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: type = tuple_type (i32) [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.7: type = array_type %.6, f64 [template]
+// CHECK:STDOUT:   %.8: type = ptr_type [f64; 2] [template]
+// CHECK:STDOUT:   %.9: f64 = real_literal 111e-1 [template]
+// CHECK:STDOUT:   %.10: f64 = real_literal 22e-1 [template]
+// CHECK:STDOUT:   %.11: type = tuple_type (f64, f64) [template]
+// CHECK:STDOUT:   %.12: type = tuple_type () [template]
+// CHECK:STDOUT:   %.13: i32 = int_literal 5 [template]
+// CHECK:STDOUT:   %.14: type = array_type %.13, () [template]
+// CHECK:STDOUT:   %.15: type = ptr_type [(); 5] [template]
+// CHECK:STDOUT:   %.16: type = tuple_type ((), (), (), (), ()) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a, .b = %b, .c = %c}
-// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1 [template = constants.%.loc7_14]
-// CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.loc7_15.1]
+// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref [i32; 1] = var a
 // CHECK:STDOUT:   %a: ref [i32; 1] = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template = constants.%.loc7_20]
+// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template = constants.%.4]
 // CHECK:STDOUT:   %.loc7_22.1: (i32,) = tuple_literal (%.loc7_20)
 // CHECK:STDOUT:   %.loc7_22.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc7_22.3: ref i32 = array_index %a.var, %.loc7_22.2
@@ -43,12 +43,12 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT:   %.loc7_22.5: init [i32; 1] = array_init (%.loc7_22.4) to %a.var
 // CHECK:STDOUT:   %.loc7_22.6: init [i32; 1] = converted %.loc7_22.1, %.loc7_22.5
 // CHECK:STDOUT:   assign %a.var, %.loc7_22.6
-// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 2 [template = constants.%.loc8_14]
-// CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.loc8_15.1]
+// CHECK:STDOUT:   %.loc8_14: i32 = int_literal 2 [template = constants.%.6]
+// CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, f64 [template = constants.%.7]
 // CHECK:STDOUT:   %b.var: ref [f64; 2] = var b
 // CHECK:STDOUT:   %b: ref [f64; 2] = bind_name b, %b.var
-// CHECK:STDOUT:   %.loc8_20: f64 = real_literal 111e-1 [template = constants.%.loc8_20]
-// CHECK:STDOUT:   %.loc8_26: f64 = real_literal 22e-1 [template = constants.%.loc8_26]
+// CHECK:STDOUT:   %.loc8_20: f64 = real_literal 111e-1 [template = constants.%.9]
+// CHECK:STDOUT:   %.loc8_26: f64 = real_literal 22e-1 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc8_30.1: (f64, f64) = tuple_literal (%.loc8_20, %.loc8_26)
 // CHECK:STDOUT:   %.loc8_30.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc8_30.3: ref f64 = array_index %b.var, %.loc8_30.2
@@ -60,9 +60,9 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT:   %.loc8_30.9: init [f64; 2] = converted %.loc8_30.1, %.loc8_30.8
 // CHECK:STDOUT:   assign %b.var, %.loc8_30.9
 // CHECK:STDOUT:   %.loc9_10.1: () = tuple_literal ()
-// CHECK:STDOUT:   %.loc9_13: i32 = int_literal 5 [template = constants.%.loc9_13]
-// CHECK:STDOUT:   %.loc9_10.2: type = converted %.loc9_10.1, constants.%.loc9_10 [template = constants.%.loc9_10]
-// CHECK:STDOUT:   %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.loc9_14.1]
+// CHECK:STDOUT:   %.loc9_13: i32 = int_literal 5 [template = constants.%.13]
+// CHECK:STDOUT:   %.loc9_10.2: type = converted %.loc9_10.1, constants.%.12 [template = constants.%.12]
+// CHECK:STDOUT:   %.loc9_14: type = array_type %.loc9_13, () [template = constants.%.14]
 // CHECK:STDOUT:   %c.var: ref [(); 5] = var c
 // CHECK:STDOUT:   %c: ref [(); 5] = bind_name c, %c.var
 // CHECK:STDOUT:   %.loc9_20.1: () = tuple_literal ()

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

@@ -12,14 +12,14 @@ var a: [1; 39999999999999999993];
 // CHECK:STDOUT: --- fail_bound_overflow.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 39999999999999999993 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 39999999999999999993 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a}
-// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template = constants.%.loc10_9]
-// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 39999999999999999993 [template = constants.%.loc10_12]
+// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 39999999999999999993 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref <error> = var a
 // CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var
 // CHECK:STDOUT: }

+ 7 - 7
toolchain/check/testdata/array/fail_incomplete_element.carbon

@@ -22,10 +22,10 @@ var p: Incomplete* = &a[0];
 // CHECK:STDOUT: --- fail_incomplete_element.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc15_21: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc15_22: type = array_type %.loc15_21, Incomplete [template]
-// CHECK:STDOUT:   %.loc20_25: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc20_22: type = ptr_type <error> [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, Incomplete [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.4: type = ptr_type <error> [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -33,8 +33,8 @@ var p: Incomplete* = &a[0];
 // CHECK:STDOUT:   %Incomplete.decl = class_decl @Incomplete, ()
 // CHECK:STDOUT:   %Incomplete: type = class_type @Incomplete [template]
 // CHECK:STDOUT:   %Incomplete.ref.loc15: type = name_ref Incomplete, %Incomplete [template = %Incomplete]
-// CHECK:STDOUT:   %.loc15_21: i32 = int_literal 1 [template = constants.%.loc15_21]
-// CHECK:STDOUT:   %.loc15_22: type = array_type %.loc15_21, Incomplete [template = constants.%.loc15_22]
+// CHECK:STDOUT:   %.loc15_21: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc15_22: type = array_type %.loc15_21, Incomplete [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref <error> = var a
 // CHECK:STDOUT:   %a: ref <error> = bind_name a, %a.var
 // CHECK:STDOUT:   %Incomplete.ref.loc20: type = name_ref Incomplete, %Incomplete [template = %Incomplete]
@@ -42,7 +42,7 @@ var p: Incomplete* = &a[0];
 // CHECK:STDOUT:   %p.var: ref Incomplete* = var p
 // CHECK:STDOUT:   %p: ref Incomplete* = bind_name p, %p.var
 // CHECK:STDOUT:   %a.ref: ref <error> = name_ref a, %a
-// CHECK:STDOUT:   %.loc20_25: i32 = int_literal 0 [template = constants.%.loc20_25]
+// CHECK:STDOUT:   %.loc20_25: i32 = int_literal 0 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc20_22: <error>* = addr_of <error>
 // CHECK:STDOUT:   assign %p.var, <error>
 // CHECK:STDOUT: }

+ 7 - 7
toolchain/check/testdata/array/fail_invalid_type.carbon

@@ -12,17 +12,17 @@ var a: [1; 1];
 // CHECK:STDOUT: --- fail_invalid_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_13.1: type = array_type %.loc10_12, <error> [template]
-// CHECK:STDOUT:   %.loc10_13.2: type = ptr_type [<error>; 1] [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.3: type = array_type %.2, <error> [template]
+// CHECK:STDOUT:   %.4: type = ptr_type [<error>; 1] [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a}
-// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template = constants.%.loc10_9]
-// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 1 [template = constants.%.loc10_12]
-// CHECK:STDOUT:   %.loc10_13: type = array_type %.loc10_12, <error> [template = constants.%.loc10_13.1]
+// CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_12: i32 = int_literal 1 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc10_13: type = array_type %.loc10_12, <error> [template = constants.%.3]
 // CHECK:STDOUT:   %a.var: ref [<error>; 1] = var a
 // CHECK:STDOUT:   %a: ref [<error>; 1] = bind_name a, %a.var
 // CHECK:STDOUT: }

+ 12 - 12
toolchain/check/testdata/array/fail_out_of_bound.carbon

@@ -12,24 +12,24 @@ var a: [i32; 1] = (1, 2, 3);
 // CHECK:STDOUT: --- fail_out_of_bound.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_15.1: type = array_type %.loc10_14, i32 [template]
-// CHECK:STDOUT:   %.loc10_15.2: type = ptr_type [i32; 1] [template]
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_23: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc10_26: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc10_27: type = tuple_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 1] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.7: type = tuple_type (i32, i32, i32) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a}
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template = constants.%.loc10_14]
-// CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32 [template = constants.%.loc10_15.1]
+// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref [i32; 1] = var a
 // CHECK:STDOUT:   %a: ref [i32; 1] = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.loc10_20]
-// CHECK:STDOUT:   %.loc10_23: i32 = int_literal 2 [template = constants.%.loc10_23]
-// CHECK:STDOUT:   %.loc10_26: i32 = int_literal 3 [template = constants.%.loc10_26]
+// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_23: i32 = int_literal 2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc10_26: i32 = int_literal 3 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc10_27: (i32, i32, i32) = tuple_literal (%.loc10_20, %.loc10_23, %.loc10_26)
 // CHECK:STDOUT:   assign %a.var, <error>
 // CHECK:STDOUT: }

+ 40 - 40
toolchain/check/testdata/array/fail_type_mismatch.carbon

@@ -29,50 +29,50 @@ var d: [i32; 3] = t2;
 // CHECK:STDOUT: --- fail_type_mismatch.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc10_15.1: type = array_type %.loc10_14, i32 [template]
-// CHECK:STDOUT:   %.loc10_15.2: type = ptr_type [i32; 3] [template]
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.1: type = ptr_type String [template]
-// CHECK:STDOUT:   %.loc10_23: String = string_literal "Hello" [template]
-// CHECK:STDOUT:   %.loc10_32: String = string_literal "World" [template]
-// CHECK:STDOUT:   %.loc10_39.1: type = tuple_type (i32, String, String) [template]
-// CHECK:STDOUT:   %.loc12: type = tuple_type (type, type, type) [template]
-// CHECK:STDOUT:   %.loc10_39.2: type = tuple_type (i32, String*, String*) [template]
-// CHECK:STDOUT:   %.loc10_39.3: type = ptr_type (i32, String*, String*) [template]
-// CHECK:STDOUT:   %.loc16_14: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc16_15: type = array_type %.loc16_14, i32 [template]
-// CHECK:STDOUT:   %.loc21_14: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc21_15: type = array_type %.loc21_14, i32 [template]
-// CHECK:STDOUT:   %.loc21_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc21_23: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc21_24.1: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc23: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc21_24.2: type = ptr_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc27_14: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc27_15: type = array_type %.loc27_14, i32 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 3] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: type = ptr_type String [template]
+// CHECK:STDOUT:   %.6: String = string_literal "Hello" [template]
+// CHECK:STDOUT:   %.7: String = string_literal "World" [template]
+// CHECK:STDOUT:   %.8: type = tuple_type (i32, String, String) [template]
+// CHECK:STDOUT:   %.9: type = tuple_type (type, type, type) [template]
+// CHECK:STDOUT:   %.10: type = tuple_type (i32, String*, String*) [template]
+// CHECK:STDOUT:   %.11: type = ptr_type (i32, String*, String*) [template]
+// CHECK:STDOUT:   %.12: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.13: type = array_type %.12, i32 [template]
+// CHECK:STDOUT:   %.14: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.15: type = array_type %.14, i32 [template]
+// CHECK:STDOUT:   %.16: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.17: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.18: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.19: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.20: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.21: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.22: type = array_type %.21, i32 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a, .t1 = %t1, .b = %b, .c = %c, .t2 = %t2, .d = %d}
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 3 [template = constants.%.loc10_14]
-// CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32 [template = constants.%.loc10_15.1]
+// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 3 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref [i32; 3] = var a
 // CHECK:STDOUT:   %a: ref [i32; 3] = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.loc10_20]
-// CHECK:STDOUT:   %.loc10_23: String = string_literal "Hello" [template = constants.%.loc10_23]
-// CHECK:STDOUT:   %.loc10_32: String = string_literal "World" [template = constants.%.loc10_32]
+// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_23: String = string_literal "Hello" [template = constants.%.6]
+// CHECK:STDOUT:   %.loc10_32: String = string_literal "World" [template = constants.%.7]
 // CHECK:STDOUT:   %.loc10_39.1: (i32, String, String) = tuple_literal (%.loc10_20, %.loc10_23, %.loc10_32)
 // CHECK:STDOUT:   %.loc10_39.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc10_39.3: ref i32 = array_index %a.var, %.loc10_39.2
 // CHECK:STDOUT:   %.loc10_39.4: init i32 = initialize_from %.loc10_20 to %.loc10_39.3
 // CHECK:STDOUT:   assign %a.var, <error>
-// CHECK:STDOUT:   %.loc12: (type, type, type) = tuple_literal (i32, String, String)
-// CHECK:STDOUT:   %.loc10_39.5: type = converted %.loc12, constants.%.loc10_39.1 [template = constants.%.loc10_39.1]
+// CHECK:STDOUT:   %.loc12_29.1: (type, type, type) = tuple_literal (i32, String, String)
+// CHECK:STDOUT:   %.loc12_29.2: type = converted %.loc12_29.1, constants.%.8 [template = constants.%.8]
 // CHECK:STDOUT:   %t1.var: ref (i32, String, String) = var t1
 // CHECK:STDOUT:   %t1: ref (i32, String, String) = bind_name t1, %t1.var
-// CHECK:STDOUT:   %.loc16_14: i32 = int_literal 3 [template = constants.%.loc16_14]
-// CHECK:STDOUT:   %.loc16_15: type = array_type %.loc16_14, i32 [template = constants.%.loc16_15]
+// CHECK:STDOUT:   %.loc16_14: i32 = int_literal 3 [template = constants.%.12]
+// CHECK:STDOUT:   %.loc16_15: type = array_type %.loc16_14, i32 [template = constants.%.13]
 // CHECK:STDOUT:   %b.var: ref [i32; 3] = var b
 // CHECK:STDOUT:   %b: ref [i32; 3] = bind_name b, %b.var
 // CHECK:STDOUT:   %t1.ref: ref (i32, String, String) = name_ref t1, %t1
@@ -83,20 +83,20 @@ var d: [i32; 3] = t2;
 // CHECK:STDOUT:   %.loc16_19.5: init i32 = initialize_from %.loc16_19.2 to %.loc16_19.4
 // CHECK:STDOUT:   %.loc16_19.6: ref String = tuple_access %t1.ref, element1
 // CHECK:STDOUT:   assign %b.var, <error>
-// CHECK:STDOUT:   %.loc21_14: i32 = int_literal 3 [template = constants.%.loc21_14]
-// CHECK:STDOUT:   %.loc21_15: type = array_type %.loc21_14, i32 [template = constants.%.loc21_15]
+// CHECK:STDOUT:   %.loc21_14: i32 = int_literal 3 [template = constants.%.14]
+// CHECK:STDOUT:   %.loc21_15: type = array_type %.loc21_14, i32 [template = constants.%.15]
 // CHECK:STDOUT:   %c.var: ref [i32; 3] = var c
 // CHECK:STDOUT:   %c: ref [i32; 3] = bind_name c, %c.var
-// CHECK:STDOUT:   %.loc21_20: i32 = int_literal 1 [template = constants.%.loc21_20]
-// CHECK:STDOUT:   %.loc21_23: i32 = int_literal 2 [template = constants.%.loc21_23]
-// CHECK:STDOUT:   %.loc21_24.1: (i32, i32) = tuple_literal (%.loc21_20, %.loc21_23)
+// CHECK:STDOUT:   %.loc21_20: i32 = int_literal 1 [template = constants.%.16]
+// CHECK:STDOUT:   %.loc21_23: i32 = int_literal 2 [template = constants.%.17]
+// CHECK:STDOUT:   %.loc21_24: (i32, i32) = tuple_literal (%.loc21_20, %.loc21_23)
 // CHECK:STDOUT:   assign %c.var, <error>
-// CHECK:STDOUT:   %.loc23: (type, type) = tuple_literal (i32, i32)
-// CHECK:STDOUT:   %.loc21_24.2: type = converted %.loc23, constants.%.loc21_24.1 [template = constants.%.loc21_24.1]
+// CHECK:STDOUT:   %.loc23_18.1: (type, type) = tuple_literal (i32, i32)
+// CHECK:STDOUT:   %.loc23_18.2: type = converted %.loc23_18.1, constants.%.18 [template = constants.%.18]
 // CHECK:STDOUT:   %t2.var: ref (i32, i32) = var t2
 // CHECK:STDOUT:   %t2: ref (i32, i32) = bind_name t2, %t2.var
-// CHECK:STDOUT:   %.loc27_14: i32 = int_literal 3 [template = constants.%.loc27_14]
-// CHECK:STDOUT:   %.loc27_15: type = array_type %.loc27_14, i32 [template = constants.%.loc27_15]
+// CHECK:STDOUT:   %.loc27_14: i32 = int_literal 3 [template = constants.%.21]
+// CHECK:STDOUT:   %.loc27_15: type = array_type %.loc27_14, i32 [template = constants.%.22]
 // CHECK:STDOUT:   %d.var: ref [i32; 3] = var d
 // CHECK:STDOUT:   %d: ref [i32; 3] = bind_name d, %d.var
 // CHECK:STDOUT:   %t2.ref: ref (i32, i32) = name_ref t2, %t2

+ 16 - 16
toolchain/check/testdata/array/function_param.carbon

@@ -15,14 +15,14 @@ fn G() -> i32 {
 // CHECK:STDOUT: --- function_param.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_17: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc7_18.1: type = array_type %.loc7_17, i32 [template]
-// CHECK:STDOUT:   %.loc7_18.2: type = ptr_type [i32; 3] [template]
-// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc12_16: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc12_19: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc12_20: type = tuple_type (i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc12_23: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 3] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.7: type = tuple_type (i32, i32, i32) [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -44,11 +44,11 @@ fn G() -> i32 {
 // CHECK:STDOUT: fn @G() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %F.ref: <function> = name_ref F, file.%F [template = file.%F]
-// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 1 [template = constants.%.loc12_13]
-// CHECK:STDOUT:   %.loc12_16: i32 = int_literal 2 [template = constants.%.loc12_16]
-// CHECK:STDOUT:   %.loc12_19: i32 = int_literal 3 [template = constants.%.loc12_19]
+// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc12_16: i32 = int_literal 2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc12_19: i32 = int_literal 3 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc12_20.1: (i32, i32, i32) = tuple_literal (%.loc12_13, %.loc12_16, %.loc12_19)
-// CHECK:STDOUT:   %.loc12_23: i32 = int_literal 1 [template = constants.%.loc12_23]
+// CHECK:STDOUT:   %.loc12_23: i32 = int_literal 1 [template = constants.%.8]
 // CHECK:STDOUT:   %.loc12_20.2: ref [i32; 3] = temporary_storage
 // CHECK:STDOUT:   %.loc12_20.3: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc12_20.4: ref i32 = array_index %.loc12_20.2, %.loc12_20.3
@@ -63,9 +63,9 @@ fn G() -> i32 {
 // CHECK:STDOUT:   %.loc12_20.13: init [i32; 3] = converted %.loc12_20.1, %.loc12_20.12
 // CHECK:STDOUT:   %.loc12_20.14: ref [i32; 3] = temporary %.loc12_20.2, %.loc12_20.13
 // CHECK:STDOUT:   %.loc12_20.15: [i32; 3] = bind_value %.loc12_20.14
-// CHECK:STDOUT:   %.loc12_11: init i32 = call %F.ref(%.loc12_20.15, %.loc12_23)
-// CHECK:STDOUT:   %.loc12_25.1: i32 = value_of_initializer %.loc12_11
-// CHECK:STDOUT:   %.loc12_25.2: i32 = converted %.loc12_11, %.loc12_25.1
-// CHECK:STDOUT:   return %.loc12_25.2
+// CHECK:STDOUT:   %.loc12_11.1: init i32 = call %F.ref(%.loc12_20.15, %.loc12_23)
+// CHECK:STDOUT:   %.loc12_25: i32 = value_of_initializer %.loc12_11.1
+// CHECK:STDOUT:   %.loc12_11.2: i32 = converted %.loc12_11.1, %.loc12_25
+// CHECK:STDOUT:   return %.loc12_11.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 24 - 24
toolchain/check/testdata/array/nine_elements.carbon

@@ -9,36 +9,36 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
 // CHECK:STDOUT: --- nine_elements.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 9 [template]
-// CHECK:STDOUT:   %.loc7_15.1: type = array_type %.loc7_14, i32 [template]
-// CHECK:STDOUT:   %.loc7_15.2: type = ptr_type [i32; 9] [template]
-// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc7_23: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc7_26: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc7_29: i32 = int_literal 4 [template]
-// CHECK:STDOUT:   %.loc7_32: i32 = int_literal 5 [template]
-// CHECK:STDOUT:   %.loc7_35: i32 = int_literal 6 [template]
-// CHECK:STDOUT:   %.loc7_38: i32 = int_literal 7 [template]
-// CHECK:STDOUT:   %.loc7_41: i32 = int_literal 8 [template]
-// CHECK:STDOUT:   %.loc7_44: i32 = int_literal 9 [template]
-// CHECK:STDOUT:   %.loc7_45: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 9 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 9] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 4 [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 5 [template]
+// CHECK:STDOUT:   %.9: i32 = int_literal 6 [template]
+// CHECK:STDOUT:   %.10: i32 = int_literal 7 [template]
+// CHECK:STDOUT:   %.11: i32 = int_literal 8 [template]
+// CHECK:STDOUT:   %.12: i32 = int_literal 9 [template]
+// CHECK:STDOUT:   %.13: type = tuple_type (i32, i32, i32, i32, i32, i32, i32, i32, i32) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a}
-// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 9 [template = constants.%.loc7_14]
-// CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.loc7_15.1]
+// CHECK:STDOUT:   %.loc7_14: i32 = int_literal 9 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32 [template = constants.%.2]
 // CHECK:STDOUT:   %a.var: ref [i32; 9] = var a
 // CHECK:STDOUT:   %a: ref [i32; 9] = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template = constants.%.loc7_20]
-// CHECK:STDOUT:   %.loc7_23: i32 = int_literal 2 [template = constants.%.loc7_23]
-// CHECK:STDOUT:   %.loc7_26: i32 = int_literal 3 [template = constants.%.loc7_26]
-// CHECK:STDOUT:   %.loc7_29: i32 = int_literal 4 [template = constants.%.loc7_29]
-// CHECK:STDOUT:   %.loc7_32: i32 = int_literal 5 [template = constants.%.loc7_32]
-// CHECK:STDOUT:   %.loc7_35: i32 = int_literal 6 [template = constants.%.loc7_35]
-// CHECK:STDOUT:   %.loc7_38: i32 = int_literal 7 [template = constants.%.loc7_38]
-// CHECK:STDOUT:   %.loc7_41: i32 = int_literal 8 [template = constants.%.loc7_41]
-// CHECK:STDOUT:   %.loc7_44: i32 = int_literal 9 [template = constants.%.loc7_44]
+// CHECK:STDOUT:   %.loc7_20: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc7_23: i32 = int_literal 2 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc7_26: i32 = int_literal 3 [template = constants.%.6]
+// CHECK:STDOUT:   %.loc7_29: i32 = int_literal 4 [template = constants.%.7]
+// CHECK:STDOUT:   %.loc7_32: i32 = int_literal 5 [template = constants.%.8]
+// CHECK:STDOUT:   %.loc7_35: i32 = int_literal 6 [template = constants.%.9]
+// CHECK:STDOUT:   %.loc7_38: i32 = int_literal 7 [template = constants.%.10]
+// CHECK:STDOUT:   %.loc7_41: i32 = int_literal 8 [template = constants.%.11]
+// CHECK:STDOUT:   %.loc7_44: i32 = int_literal 9 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc7_45.1: (i32, i32, i32, i32, i32, i32, i32, i32, i32) = tuple_literal (%.loc7_20, %.loc7_23, %.loc7_26, %.loc7_29, %.loc7_32, %.loc7_35, %.loc7_38, %.loc7_41, %.loc7_44)
 // CHECK:STDOUT:   %.loc7_45.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc7_45.3: ref i32 = array_index %a.var, %.loc7_45.2

+ 5 - 5
toolchain/check/testdata/as/as_type.carbon

@@ -9,14 +9,14 @@ let t: type = (i32, i32) as type;
 // CHECK:STDOUT: --- as_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_24: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc7_26: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {}
-// CHECK:STDOUT:   %.loc7_24: (type, type) = tuple_literal (i32, i32)
-// CHECK:STDOUT:   %.loc7_26: type = converted %.loc7_24, constants.%.loc7_26 [template = constants.%.loc7_26]
-// CHECK:STDOUT:   %t: type = bind_name t, %.loc7_26
+// CHECK:STDOUT:   %.loc7_24.1: (type, type) = tuple_literal (i32, i32)
+// CHECK:STDOUT:   %.loc7_24.2: type = converted %.loc7_24.1, constants.%.2 [template = constants.%.2]
+// CHECK:STDOUT:   %t: type = bind_name t, %.loc7_24.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 2
toolchain/check/testdata/as/basic.carbon

@@ -11,7 +11,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT: --- basic.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -21,7 +21,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 1 [template = constants.%.loc8]
+// CHECK:STDOUT:   %.loc8: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc8
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 8 - 8
toolchain/check/testdata/as/fail_no_conversion.carbon

@@ -12,19 +12,19 @@ let n: (i32, i32) = 1 as (i32, i32);
 // CHECK:STDOUT: --- fail_no_conversion.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_17.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc10_17.2: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc10_17.3: type = ptr_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc10_21: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {}
 // CHECK:STDOUT:   %.loc10_17.1: (type, type) = tuple_literal (i32, i32)
-// CHECK:STDOUT:   %.loc10_17.2: type = converted %.loc10_17.1, constants.%.loc10_17.2 [template = constants.%.loc10_17.2]
-// CHECK:STDOUT:   %.loc10_21: i32 = int_literal 1 [template = constants.%.loc10_21]
-// CHECK:STDOUT:   %.loc10_35: (type, type) = tuple_literal (i32, i32)
-// CHECK:STDOUT:   %.loc10_17.3: type = converted %.loc10_35, constants.%.loc10_17.2 [template = constants.%.loc10_17.2]
+// CHECK:STDOUT:   %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc10_21: i32 = int_literal 1 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc10_35.1: (type, type) = tuple_literal (i32, i32)
+// CHECK:STDOUT:   %.loc10_35.2: type = converted %.loc10_35.1, constants.%.2 [template = constants.%.2]
 // CHECK:STDOUT:   %n: (i32, i32) = bind_name n, <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

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

@@ -12,14 +12,14 @@ let n: i32 = 1 as 2;
 // CHECK:STDOUT: --- fail_not_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 2 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {}
-// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template = constants.%.loc10_14]
-// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 2 [template = constants.%.loc10_19]
+// CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 2 [template = constants.%.2]
 // CHECK:STDOUT:   %n: i32 = bind_name n, <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 3 - 3
toolchain/check/testdata/as/identity.carbon

@@ -27,9 +27,9 @@ fn Initializing() {
 // CHECK:STDOUT: --- identity.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc11_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc9: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 14 - 14
toolchain/check/testdata/as/tuple.carbon

@@ -23,13 +23,13 @@ fn Var() {
 // CHECK:STDOUT: --- tuple.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc9_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc15_15.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc15_15.2: type = tuple_type (X, X) [template]
-// CHECK:STDOUT:   %.loc15_15.3: type = tuple_type ({}*, {}*) [template]
-// CHECK:STDOUT:   %.loc15_15.4: type = ptr_type ({}*, {}*) [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.5: type = tuple_type (X, X) [template]
+// CHECK:STDOUT:   %.6: type = tuple_type ({}*, {}*) [template]
+// CHECK:STDOUT:   %.7: type = ptr_type ({}*, {}*) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -53,7 +53,7 @@ fn Var() {
 // CHECK:STDOUT:   %X.ref.loc15_11: type = name_ref X, file.%X [template = file.%X]
 // CHECK:STDOUT:   %X.ref.loc15_14: type = name_ref X, file.%X [template = file.%X]
 // CHECK:STDOUT:   %.loc15_15.1: (type, type) = tuple_literal (%X.ref.loc15_11, %X.ref.loc15_14)
-// CHECK:STDOUT:   %.loc15_15.2: type = converted %.loc15_15.1, constants.%.loc15_15.2 [template = constants.%.loc15_15.2]
+// CHECK:STDOUT:   %.loc15_15.2: type = converted %.loc15_15.1, constants.%.5 [template = constants.%.5]
 // CHECK:STDOUT:   %Make.ref.loc15_20: <function> = name_ref Make, file.%Make [template = file.%Make]
 // CHECK:STDOUT:   %.loc15_24.1: ref X = temporary_storage
 // CHECK:STDOUT:   %.loc15_24.2: init X = call %Make.ref.loc15_20() to %.loc15_24.1
@@ -63,8 +63,8 @@ fn Var() {
 // CHECK:STDOUT:   %.loc15_34.1: (X, X) = tuple_literal (%.loc15_24.2, %.loc15_32.2)
 // CHECK:STDOUT:   %X.ref.loc15_40: type = name_ref X, file.%X [template = file.%X]
 // CHECK:STDOUT:   %X.ref.loc15_43: type = name_ref X, file.%X [template = file.%X]
-// CHECK:STDOUT:   %.loc15_44: (type, type) = tuple_literal (%X.ref.loc15_40, %X.ref.loc15_43)
-// CHECK:STDOUT:   %.loc15_15.3: type = converted %.loc15_44, constants.%.loc15_15.2 [template = constants.%.loc15_15.2]
+// CHECK:STDOUT:   %.loc15_44.1: (type, type) = tuple_literal (%X.ref.loc15_40, %X.ref.loc15_43)
+// CHECK:STDOUT:   %.loc15_44.2: type = converted %.loc15_44.1, constants.%.5 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc15_24.3: ref X = temporary %.loc15_24.1, %.loc15_24.2
 // CHECK:STDOUT:   %.loc15_24.4: X = bind_value %.loc15_24.3
 // CHECK:STDOUT:   %.loc15_32.3: ref X = temporary %.loc15_32.1, %.loc15_32.2
@@ -79,8 +79,8 @@ fn Var() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %X.ref.loc20_11: type = name_ref X, file.%X [template = file.%X]
 // CHECK:STDOUT:   %X.ref.loc20_14: type = name_ref X, file.%X [template = file.%X]
-// CHECK:STDOUT:   %.loc20_15: (type, type) = tuple_literal (%X.ref.loc20_11, %X.ref.loc20_14)
-// CHECK:STDOUT:   %.loc15_15.1: type = converted %.loc20_15, constants.%.loc15_15.2 [template = constants.%.loc15_15.2]
+// CHECK:STDOUT:   %.loc20_15.1: (type, type) = tuple_literal (%X.ref.loc20_11, %X.ref.loc20_14)
+// CHECK:STDOUT:   %.loc20_15.2: type = converted %.loc20_15.1, constants.%.5 [template = constants.%.5]
 // CHECK:STDOUT:   %b.var: ref (X, X) = var b
 // CHECK:STDOUT:   %b: ref (X, X) = bind_name b, %b.var
 // CHECK:STDOUT:   %Make.ref.loc20_20: <function> = name_ref Make, file.%Make [template = file.%Make]
@@ -92,8 +92,8 @@ fn Var() {
 // CHECK:STDOUT:   %.loc20_34.3: (X, X) = tuple_literal (%.loc20_24, %.loc20_32)
 // CHECK:STDOUT:   %X.ref.loc20_40: type = name_ref X, file.%X [template = file.%X]
 // CHECK:STDOUT:   %X.ref.loc20_43: type = name_ref X, file.%X [template = file.%X]
-// CHECK:STDOUT:   %.loc20_44: (type, type) = tuple_literal (%X.ref.loc20_40, %X.ref.loc20_43)
-// CHECK:STDOUT:   %.loc15_15.2: type = converted %.loc20_44, constants.%.loc15_15.2 [template = constants.%.loc15_15.2]
+// CHECK:STDOUT:   %.loc20_44.1: (type, type) = tuple_literal (%X.ref.loc20_40, %X.ref.loc20_43)
+// CHECK:STDOUT:   %.loc20_44.2: type = converted %.loc20_44.1, constants.%.5 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc20_34.4: init (X, X) = tuple_init (%.loc20_24, %.loc20_32) to %b.var
 // CHECK:STDOUT:   %.loc20_34.5: init (X, X) = converted %.loc20_34.3, %.loc20_34.4
 // CHECK:STDOUT:   assign %b.var, %.loc20_34.5

+ 7 - 7
toolchain/check/testdata/basics/builtin_types.carbon

@@ -12,23 +12,23 @@ var test_type: type = i32;
 // CHECK:STDOUT: --- builtin_types.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc8: f64 = real_literal 1e-1 [template]
-// CHECK:STDOUT:   %.1: type = ptr_type String [template]
-// CHECK:STDOUT:   %.loc9: String = string_literal "Test" [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.2: f64 = real_literal 1e-1 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type String [template]
+// CHECK:STDOUT:   %.4: String = string_literal "Test" [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.test_i32 = %test_i32, .test_f64 = %test_f64, .test_type = %test_type}
 // CHECK:STDOUT:   %test_i32.var: ref i32 = var test_i32
 // CHECK:STDOUT:   %test_i32: ref i32 = bind_name test_i32, %test_i32.var
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.loc7]
+// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
 // CHECK:STDOUT:   assign %test_i32.var, %.loc7
 // CHECK:STDOUT:   %test_f64.var: ref f64 = var test_f64
 // CHECK:STDOUT:   %test_f64: ref f64 = bind_name test_f64, %test_f64.var
-// CHECK:STDOUT:   %.loc8: f64 = real_literal 1e-1 [template = constants.%.loc8]
+// CHECK:STDOUT:   %.loc8: f64 = real_literal 1e-1 [template = constants.%.2]
 // CHECK:STDOUT:   assign %test_f64.var, %.loc8
-// CHECK:STDOUT:   %.loc9: String = string_literal "Test" [template = constants.%.loc9]
+// CHECK:STDOUT:   %.loc9: String = string_literal "Test" [template = constants.%.4]
 // CHECK:STDOUT:   %test_str: String = bind_name test_str, %.loc9
 // CHECK:STDOUT:   %test_type.var: ref type = var test_type
 // CHECK:STDOUT:   %test_type: ref type = bind_name test_type, %test_type.var

+ 1 - 1
toolchain/check/testdata/basics/fail_bad_run.carbon

@@ -16,7 +16,7 @@ fn Run() -> String {}
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %.1: type = ptr_type String [template]
-// CHECK:STDOUT:   %.loc13: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 2 - 2
toolchain/check/testdata/basics/fail_non_type_as_type.carbon

@@ -12,14 +12,14 @@ var x: type = 42;
 // CHECK:STDOUT: --- fail_non_type_as_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10: i32 = int_literal 42 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 42 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.x = %x}
 // CHECK:STDOUT:   %x.var: ref type = var x
 // CHECK:STDOUT:   %x: ref type = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc10: i32 = int_literal 42 [template = constants.%.loc10]
+// CHECK:STDOUT:   %.loc10: i32 = int_literal 42 [template = constants.%.1]
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 36 - 36
toolchain/check/testdata/basics/numeric_literals.carbon

@@ -28,26 +28,26 @@ fn F() {
 // CHECK:STDOUT: --- numeric_literals.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 5 [template]
-// CHECK:STDOUT:   %.loc10_20.1: type = array_type %.loc10_19, i32 [template]
-// CHECK:STDOUT:   %.loc10_20.2: type = ptr_type [i32; 5] [template]
-// CHECK:STDOUT:   %.loc11: i32 = int_literal 8 [template]
-// CHECK:STDOUT:   %.loc12: i32 = int_literal 9 [template]
-// CHECK:STDOUT:   %.loc13: i32 = int_literal 8 [template]
-// CHECK:STDOUT:   %.loc14: i32 = int_literal 8 [template]
-// CHECK:STDOUT:   %.loc15: i32 = int_literal 39999999999999999993 [template]
-// CHECK:STDOUT:   %.loc16: type = tuple_type (i32, i32, i32, i32, i32) [template]
-// CHECK:STDOUT:   %.loc17_21: i32 = int_literal 7 [template]
-// CHECK:STDOUT:   %.loc17_22.1: type = array_type %.loc17_21, f64 [template]
-// CHECK:STDOUT:   %.loc17_22.2: type = ptr_type [f64; 7] [template]
-// CHECK:STDOUT:   %.loc18: f64 = real_literal 9e-1 [template]
-// CHECK:STDOUT:   %.loc19: f64 = real_literal 80e-1 [template]
-// CHECK:STDOUT:   %.loc20: f64 = real_literal 800e-1 [template]
-// CHECK:STDOUT:   %.loc21: f64 = real_literal 10e6 [template]
-// CHECK:STDOUT:   %.loc22: f64 = real_literal 10e7 [template]
-// CHECK:STDOUT:   %.loc23: f64 = real_literal 10e-9 [template]
-// CHECK:STDOUT:   %.loc24: f64 = real_literal 399999999999999999930e39999999999999999992 [template]
-// CHECK:STDOUT:   %.loc25: type = tuple_type (f64, f64, f64, f64, f64, f64, f64) [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 5 [template]
+// CHECK:STDOUT:   %.2: type = array_type %.1, i32 [template]
+// CHECK:STDOUT:   %.3: type = ptr_type [i32; 5] [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 8 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 9 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 8 [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 8 [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 39999999999999999993 [template]
+// CHECK:STDOUT:   %.9: type = tuple_type (i32, i32, i32, i32, i32) [template]
+// CHECK:STDOUT:   %.10: i32 = int_literal 7 [template]
+// CHECK:STDOUT:   %.11: type = array_type %.10, f64 [template]
+// CHECK:STDOUT:   %.12: type = ptr_type [f64; 7] [template]
+// CHECK:STDOUT:   %.13: f64 = real_literal 9e-1 [template]
+// CHECK:STDOUT:   %.14: f64 = real_literal 80e-1 [template]
+// CHECK:STDOUT:   %.15: f64 = real_literal 800e-1 [template]
+// CHECK:STDOUT:   %.16: f64 = real_literal 10e6 [template]
+// CHECK:STDOUT:   %.17: f64 = real_literal 10e7 [template]
+// CHECK:STDOUT:   %.18: f64 = real_literal 10e-9 [template]
+// CHECK:STDOUT:   %.19: f64 = real_literal 399999999999999999930e39999999999999999992 [template]
+// CHECK:STDOUT:   %.20: type = tuple_type (f64, f64, f64, f64, f64, f64, f64) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -57,15 +57,15 @@ fn F() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 5 [template = constants.%.loc10_19]
-// CHECK:STDOUT:   %.loc10_20: type = array_type %.loc10_19, i32 [template = constants.%.loc10_20.1]
+// CHECK:STDOUT:   %.loc10_19: i32 = int_literal 5 [template = constants.%.1]
+// CHECK:STDOUT:   %.loc10_20: type = array_type %.loc10_19, i32 [template = constants.%.2]
 // CHECK:STDOUT:   %ints.var: ref [i32; 5] = var ints
 // CHECK:STDOUT:   %ints: ref [i32; 5] = bind_name ints, %ints.var
-// CHECK:STDOUT:   %.loc11: i32 = int_literal 8 [template = constants.%.loc11]
-// CHECK:STDOUT:   %.loc12: i32 = int_literal 9 [template = constants.%.loc12]
-// CHECK:STDOUT:   %.loc13: i32 = int_literal 8 [template = constants.%.loc13]
-// CHECK:STDOUT:   %.loc14: i32 = int_literal 8 [template = constants.%.loc14]
-// CHECK:STDOUT:   %.loc15: i32 = int_literal 39999999999999999993 [template = constants.%.loc15]
+// CHECK:STDOUT:   %.loc11: i32 = int_literal 8 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc12: i32 = int_literal 9 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc13: i32 = int_literal 8 [template = constants.%.6]
+// CHECK:STDOUT:   %.loc14: i32 = int_literal 8 [template = constants.%.7]
+// CHECK:STDOUT:   %.loc15: i32 = int_literal 39999999999999999993 [template = constants.%.8]
 // CHECK:STDOUT:   %.loc16_3.1: (i32, i32, i32, i32, i32) = tuple_literal (%.loc11, %.loc12, %.loc13, %.loc14, %.loc15)
 // CHECK:STDOUT:   %.loc16_3.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc16_3.3: ref i32 = array_index %ints.var, %.loc16_3.2
@@ -85,17 +85,17 @@ fn F() {
 // CHECK:STDOUT:   %.loc16_3.17: init [i32; 5] = array_init (%.loc16_3.4, %.loc16_3.7, %.loc16_3.10, %.loc16_3.13, %.loc16_3.16) to %ints.var
 // CHECK:STDOUT:   %.loc16_3.18: init [i32; 5] = converted %.loc16_3.1, %.loc16_3.17
 // CHECK:STDOUT:   assign %ints.var, %.loc16_3.18
-// CHECK:STDOUT:   %.loc17_21: i32 = int_literal 7 [template = constants.%.loc17_21]
-// CHECK:STDOUT:   %.loc17_22: type = array_type %.loc17_21, f64 [template = constants.%.loc17_22.1]
+// CHECK:STDOUT:   %.loc17_21: i32 = int_literal 7 [template = constants.%.10]
+// CHECK:STDOUT:   %.loc17_22: type = array_type %.loc17_21, f64 [template = constants.%.11]
 // CHECK:STDOUT:   %floats.var: ref [f64; 7] = var floats
 // CHECK:STDOUT:   %floats: ref [f64; 7] = bind_name floats, %floats.var
-// CHECK:STDOUT:   %.loc18: f64 = real_literal 9e-1 [template = constants.%.loc18]
-// CHECK:STDOUT:   %.loc19: f64 = real_literal 80e-1 [template = constants.%.loc19]
-// CHECK:STDOUT:   %.loc20: f64 = real_literal 800e-1 [template = constants.%.loc20]
-// CHECK:STDOUT:   %.loc21: f64 = real_literal 10e6 [template = constants.%.loc21]
-// CHECK:STDOUT:   %.loc22: f64 = real_literal 10e7 [template = constants.%.loc22]
-// CHECK:STDOUT:   %.loc23: f64 = real_literal 10e-9 [template = constants.%.loc23]
-// CHECK:STDOUT:   %.loc24: f64 = real_literal 399999999999999999930e39999999999999999992 [template = constants.%.loc24]
+// CHECK:STDOUT:   %.loc18: f64 = real_literal 9e-1 [template = constants.%.13]
+// CHECK:STDOUT:   %.loc19: f64 = real_literal 80e-1 [template = constants.%.14]
+// CHECK:STDOUT:   %.loc20: f64 = real_literal 800e-1 [template = constants.%.15]
+// CHECK:STDOUT:   %.loc21: f64 = real_literal 10e6 [template = constants.%.16]
+// CHECK:STDOUT:   %.loc22: f64 = real_literal 10e7 [template = constants.%.17]
+// CHECK:STDOUT:   %.loc23: f64 = real_literal 10e-9 [template = constants.%.18]
+// CHECK:STDOUT:   %.loc24: f64 = real_literal 399999999999999999930e39999999999999999992 [template = constants.%.19]
 // CHECK:STDOUT:   %.loc25_3.1: (f64, f64, f64, f64, f64, f64, f64) = tuple_literal (%.loc18, %.loc19, %.loc20, %.loc21, %.loc22, %.loc23, %.loc24)
 // CHECK:STDOUT:   %.loc25_3.2: i32 = int_literal 0
 // CHECK:STDOUT:   %.loc25_3.3: ref f64 = array_index %floats.var, %.loc25_3.2

+ 4 - 4
toolchain/check/testdata/basics/parens.carbon

@@ -10,19 +10,19 @@ var b: i32 = ((2));
 // CHECK:STDOUT: --- parens.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 2 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
 // CHECK:STDOUT:   package: <namespace> = namespace package, {.a = %a, .b = %b}
 // CHECK:STDOUT:   %a.var: ref i32 = var a
 // CHECK:STDOUT:   %a: ref i32 = bind_name a, %a.var
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 1 [template = constants.%.loc7]
+// CHECK:STDOUT:   %.loc7: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   assign %a.var, %.loc7
 // CHECK:STDOUT:   %b.var: ref i32 = var b
 // CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
-// CHECK:STDOUT:   %.loc8: i32 = int_literal 2 [template = constants.%.loc8]
+// CHECK:STDOUT:   %.loc8: i32 = int_literal 2 [template = constants.%.2]
 // CHECK:STDOUT:   assign %b.var, %.loc8
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 7
toolchain/check/testdata/basics/raw_and_textual_ir.carbon

@@ -122,11 +122,11 @@ fn Foo(n: i32) -> (i32, i32, f64) {
 // CHECK:STDOUT: --- raw_and_textual_ir.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11_33.1: type = tuple_type (type, type, type) [template]
-// CHECK:STDOUT:   %.loc11_33.2: type = tuple_type (i32, i32, f64) [template]
-// CHECK:STDOUT:   %.loc11_33.3: type = ptr_type (i32, i32, f64) [template]
-// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32, f64) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32, f64) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.5: f64 = real_literal 34e-1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -137,8 +137,8 @@ fn Foo(n: i32) -> (i32, i32, f64) {
 // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, i32, f64) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %n.ref: i32 = name_ref n, %n
-// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template = constants.%.loc12_14]
-// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.loc12_17]
+// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc12_20.1: (i32, i32, f64) = tuple_literal (%n.ref, %.loc12_14, %.loc12_17)
 // CHECK:STDOUT:   %.loc12_20.2: ref i32 = tuple_access %return, element0
 // CHECK:STDOUT:   %.loc12_20.3: init i32 = initialize_from %n.ref to %.loc12_20.2

+ 2 - 2
toolchain/check/testdata/basics/run_i32.carbon

@@ -9,7 +9,7 @@ fn Run() -> i32 { return 0; }
 // CHECK:STDOUT: --- run_i32.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -19,7 +19,7 @@ fn Run() -> i32 { return 0; }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Run() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.loc7]
+// CHECK:STDOUT:   %.loc7: i32 = int_literal 0 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc7
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 7
toolchain/check/testdata/basics/textual_ir.carbon

@@ -15,11 +15,11 @@ fn Foo(n: i32) -> (i32, i32, f64) {
 // CHECK:STDOUT: --- textual_ir.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11_33.1: type = tuple_type (type, type, type) [template]
-// CHECK:STDOUT:   %.loc11_33.2: type = tuple_type (i32, i32, f64) [template]
-// CHECK:STDOUT:   %.loc11_33.3: type = ptr_type (i32, i32, f64) [template]
-// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32, f64) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32, f64) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.5: f64 = real_literal 34e-1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -30,8 +30,8 @@ fn Foo(n: i32) -> (i32, i32, f64) {
 // CHECK:STDOUT: fn @Foo(%n: i32) -> %return: (i32, i32, f64) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %n.ref: i32 = name_ref n, %n
-// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template = constants.%.loc12_14]
-// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.loc12_17]
+// CHECK:STDOUT:   %.loc12_14: i32 = int_literal 2 [template = constants.%.4]
+// CHECK:STDOUT:   %.loc12_17: f64 = real_literal 34e-1 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc12_20.1: (i32, i32, f64) = tuple_literal (%n.ref, %.loc12_14, %.loc12_17)
 // CHECK:STDOUT:   %.loc12_20.2: ref i32 = tuple_access %return, element0
 // CHECK:STDOUT:   %.loc12_20.3: init i32 = initialize_from %n.ref to %.loc12_20.2

+ 14 - 14
toolchain/check/testdata/class/base.carbon

@@ -25,18 +25,18 @@ fn Access(d: Derived) -> (i32, i32) {
 // CHECK:STDOUT: --- base.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.b: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.b: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.1: type = struct_type {.base: Base, .d: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.2: type = struct_type {.base: {.b: i32}*, .d: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.3: type = ptr_type {.base: {.b: i32}*, .d: i32} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.base: Base, .d: i32} [template]
-// CHECK:STDOUT:   %.loc18_25: i32 = int_literal 4 [template]
-// CHECK:STDOUT:   %.loc18_34: i32 = int_literal 7 [template]
-// CHECK:STDOUT:   %.loc18_35: type = struct_type {.base: {.b: i32}, .d: i32} [template]
-// CHECK:STDOUT:   %.loc21_35.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc21_35.2: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc21_35.3: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.b: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.b: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: Base, .d: i32} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: {.b: i32}*, .d: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.base: {.b: i32}*, .d: i32} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: Base, .d: i32} [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 4 [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 7 [template]
+// CHECK:STDOUT:   %.9: type = struct_type {.base: {.b: i32}, .d: i32} [template]
+// CHECK:STDOUT:   %.10: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.11: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.12: type = ptr_type (i32, i32) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -74,9 +74,9 @@ fn Access(d: Derived) -> (i32, i32) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Make() -> %return: Derived {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc18_25: i32 = int_literal 4 [template = constants.%.loc18_25]
+// CHECK:STDOUT:   %.loc18_25: i32 = int_literal 4 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc18_26.1: {.b: i32} = struct_literal (%.loc18_25)
-// CHECK:STDOUT:   %.loc18_34: i32 = int_literal 7 [template = constants.%.loc18_34]
+// CHECK:STDOUT:   %.loc18_34: i32 = int_literal 7 [template = constants.%.8]
 // CHECK:STDOUT:   %.loc18_35.1: {.base: {.b: i32}, .d: i32} = struct_literal (%.loc18_26.1, %.loc18_34)
 // CHECK:STDOUT:   %.loc18_35.2: ref Base = class_element_access %return, element0
 // CHECK:STDOUT:   %.loc18_26.2: ref i32 = class_element_access %.loc18_35.2, element0

+ 11 - 11
toolchain/check/testdata/class/base_field.carbon

@@ -24,12 +24,12 @@ fn Access(p: Derived*) -> i32* {
 // CHECK:STDOUT: --- base_field.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11_1.1: type = struct_type {.a: i32, .b: i32, .c: i32} [template]
-// CHECK:STDOUT:   %.loc11_1.2: type = ptr_type {.a: i32, .b: i32, .c: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.1: type = struct_type {.base: Base, .d: i32, .e: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.2: type = struct_type {.base: {.a: i32, .b: i32, .c: i32}*, .d: i32, .e: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.3: type = ptr_type {.base: {.a: i32, .b: i32, .c: i32}*, .d: i32, .e: i32} [template]
-// CHECK:STDOUT:   %.loc13: type = ptr_type {.base: Base, .d: i32, .e: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32, .b: i32, .c: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32, .b: i32, .c: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: Base, .d: i32, .e: i32} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: {.a: i32, .b: i32, .c: i32}*, .d: i32, .e: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.base: {.a: i32, .b: i32, .c: i32}*, .d: i32, .e: i32} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: Base, .d: i32, .e: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -79,11 +79,11 @@ fn Access(p: Derived*) -> i32* {
 // CHECK:STDOUT: fn @Access(%p: Derived*) -> i32* {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: Derived* = name_ref p, %p
-// CHECK:STDOUT:   %.loc21_12: ref Derived = deref %p.ref
-// CHECK:STDOUT:   %.loc21_15.1: ref Base = class_element_access %.loc21_12, element0
-// CHECK:STDOUT:   %.loc21_15.2: ref Base = converted %.loc21_12, %.loc21_15.1
-// CHECK:STDOUT:   %.loc21_15.3: ref i32 = class_element_access %.loc21_15.2, element2
-// CHECK:STDOUT:   %.loc21_10: i32* = addr_of %.loc21_15.3
+// CHECK:STDOUT:   %.loc21_12.1: ref Derived = deref %p.ref
+// CHECK:STDOUT:   %.loc21_15.1: ref Base = class_element_access %.loc21_12.1, element0
+// CHECK:STDOUT:   %.loc21_12.2: ref Base = converted %.loc21_12.1, %.loc21_15.1
+// CHECK:STDOUT:   %.loc21_15.2: ref i32 = class_element_access %.loc21_12.2, element2
+// CHECK:STDOUT:   %.loc21_10: i32* = addr_of %.loc21_15.2
 // CHECK:STDOUT:   return %.loc21_10
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 4 - 4
toolchain/check/testdata/class/base_function_unqualified.carbon

@@ -22,10 +22,10 @@ fn Derived.H() {
 // CHECK:STDOUT: --- base_function_unqualified.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc9_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc16: type = struct_type {.base: Base} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: Base} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 10 - 10
toolchain/check/testdata/class/base_method.carbon

@@ -25,13 +25,13 @@ fn Call(p: Derived*) {
 // CHECK:STDOUT: --- base_method.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc19_1.1: type = struct_type {.base: Base} [template]
-// CHECK:STDOUT:   %.loc19_1.2: type = struct_type {.base: {.a: i32}*} [template]
-// CHECK:STDOUT:   %.loc17: type = ptr_type {.base: Base} [template]
-// CHECK:STDOUT:   %.loc22: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: Base} [template]
+// CHECK:STDOUT:   %.5: type = struct_type {.base: {.a: i32}*} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: Base} [template]
+// CHECK:STDOUT:   %.7: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -70,7 +70,7 @@ fn Call(p: Derived*) {
 // CHECK:STDOUT:   %self.ref: Base* = name_ref self, %self
 // CHECK:STDOUT:   %.loc14_4: ref Base = deref %self.ref
 // CHECK:STDOUT:   %.loc14_10: ref i32 = class_element_access %.loc14_4, element0
-// CHECK:STDOUT:   %.loc14_15: i32 = int_literal 1 [template = constants.%.loc14]
+// CHECK:STDOUT:   %.loc14_15: i32 = int_literal 1 [template = constants.%.3]
 // CHECK:STDOUT:   assign %.loc14_10, %.loc14_15
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
@@ -84,8 +84,8 @@ fn Call(p: Derived*) {
 // CHECK:STDOUT:   %.loc22_9.1: ref Derived = deref %.loc22_4.2
 // CHECK:STDOUT:   %.loc22_9.2: ref Base = class_element_access %.loc22_9.1, element0
 // CHECK:STDOUT:   %.loc22_9.3: Base* = addr_of %.loc22_9.2
-// CHECK:STDOUT:   %.loc22_9.4: Base* = converted %.loc22_4.2, %.loc22_9.3
-// CHECK:STDOUT:   %.loc22_9.5: init () = call %.loc22_7(%.loc22_9.4)
+// CHECK:STDOUT:   %.loc22_4.3: Base* = converted %.loc22_4.2, %.loc22_9.3
+// CHECK:STDOUT:   %.loc22_9.4: init () = call %.loc22_7(%.loc22_4.3)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 11 - 11
toolchain/check/testdata/class/base_method_shadow.carbon

@@ -32,15 +32,15 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
 // CHECK:STDOUT: --- base_method_shadow.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc9_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc14_1.1: type = struct_type {.base: A} [template]
-// CHECK:STDOUT:   %.loc14_1.2: type = struct_type {.base: {}*} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.base: A} [template]
-// CHECK:STDOUT:   %.loc19_1.1: type = struct_type {.base: B} [template]
-// CHECK:STDOUT:   %.loc19_1.2: type = struct_type {.base: {.base: A}*} [template]
-// CHECK:STDOUT:   %.loc16: type = ptr_type {.base: B} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: A} [template]
+// CHECK:STDOUT:   %.5: type = struct_type {.base: {}*} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: A} [template]
+// CHECK:STDOUT:   %.7: type = struct_type {.base: B} [template]
+// CHECK:STDOUT:   %.8: type = struct_type {.base: {.base: A}*} [template]
+// CHECK:STDOUT:   %.9: type = ptr_type {.base: B} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -127,8 +127,8 @@ fn Call(a: A*, b: B*, c: C*, d: D*) {
 // CHECK:STDOUT:   %.loc29_9.1: ref D = deref %.loc29_4.2
 // CHECK:STDOUT:   %.loc29_9.2: ref B = class_element_access %.loc29_9.1, element0
 // CHECK:STDOUT:   %.loc29_9.3: B* = addr_of %.loc29_9.2
-// CHECK:STDOUT:   %.loc29_9.4: B* = converted %.loc29_4.2, %.loc29_9.3
-// CHECK:STDOUT:   %.loc29_9.5: init () = call %.loc29_7(%.loc29_9.4)
+// CHECK:STDOUT:   %.loc29_4.3: B* = converted %.loc29_4.2, %.loc29_9.3
+// CHECK:STDOUT:   %.loc29_9.4: init () = call %.loc29_7(%.loc29_4.3)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 7
toolchain/check/testdata/class/basic.carbon

@@ -25,8 +25,8 @@ fn Run() -> i32 {
 // CHECK:STDOUT: --- basic.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc15: type = struct_type {.k: i32} [template]
-// CHECK:STDOUT:   %.loc22: i32 = int_literal 4 [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.k: i32} [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 4 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -66,10 +66,10 @@ fn Run() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Class.ref: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %F.ref: <function> = name_ref F, @Class.%F [template = @Class.%F]
-// CHECK:STDOUT:   %.loc22_18: i32 = int_literal 4 [template = constants.%.loc22]
-// CHECK:STDOUT:   %.loc22_17: init i32 = call %F.ref(%.loc22_18)
-// CHECK:STDOUT:   %.loc22_20.1: i32 = value_of_initializer %.loc22_17
-// CHECK:STDOUT:   %.loc22_20.2: i32 = converted %.loc22_17, %.loc22_20.1
-// CHECK:STDOUT:   return %.loc22_20.2
+// CHECK:STDOUT:   %.loc22_18: i32 = int_literal 4 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc22_17.1: init i32 = call %F.ref(%.loc22_18)
+// CHECK:STDOUT:   %.loc22_20: i32 = value_of_initializer %.loc22_17.1
+// CHECK:STDOUT:   %.loc22_17.2: i32 = converted %.loc22_17.1, %.loc22_20
+// CHECK:STDOUT:   return %.loc22_17.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 34 - 34
toolchain/check/testdata/class/derived_to_base.carbon

@@ -37,21 +37,21 @@ fn ConvertInit() {
 // CHECK:STDOUT: --- derived_to_base.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc14_1.1: type = struct_type {.base: A, .b: i32} [template]
-// CHECK:STDOUT:   %.loc14_1.2: type = struct_type {.base: {.a: i32}*, .b: i32} [template]
-// CHECK:STDOUT:   %.loc14_1.3: type = ptr_type {.base: {.a: i32}*, .b: i32} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.base: A, .b: i32} [template]
-// CHECK:STDOUT:   %.loc19_1.1: type = struct_type {.base: B, .c: i32} [template]
-// CHECK:STDOUT:   %.loc19_1.2: type = struct_type {.base: {.base: A, .b: i32}*, .c: i32} [template]
-// CHECK:STDOUT:   %.loc19_1.3: type = ptr_type {.base: {.base: A, .b: i32}*, .c: i32} [template]
-// CHECK:STDOUT:   %.loc16: type = ptr_type {.base: B, .c: i32} [template]
-// CHECK:STDOUT:   %.loc34_38: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc34_47: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc34_48: type = struct_type {.base: {.a: i32}, .b: i32} [template]
-// CHECK:STDOUT:   %.loc34_56: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc34_57: type = struct_type {.base: {.base: {.a: i32}, .b: i32}, .c: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: A, .b: i32} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: {.a: i32}*, .b: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.base: {.a: i32}*, .b: i32} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: A, .b: i32} [template]
+// CHECK:STDOUT:   %.7: type = struct_type {.base: B, .c: i32} [template]
+// CHECK:STDOUT:   %.8: type = struct_type {.base: {.base: A, .b: i32}*, .c: i32} [template]
+// CHECK:STDOUT:   %.9: type = ptr_type {.base: {.base: A, .b: i32}*, .c: i32} [template]
+// CHECK:STDOUT:   %.10: type = ptr_type {.base: B, .c: i32} [template]
+// CHECK:STDOUT:   %.11: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.12: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.13: type = struct_type {.base: {.a: i32}, .b: i32} [template]
+// CHECK:STDOUT:   %.14: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.15: type = struct_type {.base: {.base: {.a: i32}, .b: i32}, .c: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -113,8 +113,8 @@ fn ConvertInit() {
 // CHECK:STDOUT:   %.loc21_39.1: ref C = deref %p.ref
 // CHECK:STDOUT:   %.loc21_39.2: ref B = class_element_access %.loc21_39.1, element0
 // CHECK:STDOUT:   %.loc21_39.3: B* = addr_of %.loc21_39.2
-// CHECK:STDOUT:   %.loc21_39.4: B* = converted %p.ref, %.loc21_39.3
-// CHECK:STDOUT:   return %.loc21_39.4
+// CHECK:STDOUT:   %.loc21_38: B* = converted %p.ref, %.loc21_39.3
+// CHECK:STDOUT:   return %.loc21_38
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @ConvertBToA(%p: B*) -> A* {
@@ -123,8 +123,8 @@ fn ConvertInit() {
 // CHECK:STDOUT:   %.loc22_39.1: ref B = deref %p.ref
 // CHECK:STDOUT:   %.loc22_39.2: ref A = class_element_access %.loc22_39.1, element0
 // CHECK:STDOUT:   %.loc22_39.3: A* = addr_of %.loc22_39.2
-// CHECK:STDOUT:   %.loc22_39.4: A* = converted %p.ref, %.loc22_39.3
-// CHECK:STDOUT:   return %.loc22_39.4
+// CHECK:STDOUT:   %.loc22_38: A* = converted %p.ref, %.loc22_39.3
+// CHECK:STDOUT:   return %.loc22_38
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @ConvertCToA(%p: C*) -> A* {
@@ -134,8 +134,8 @@ fn ConvertInit() {
 // CHECK:STDOUT:   %.loc23_39.2: ref B = class_element_access %.loc23_39.1, element0
 // CHECK:STDOUT:   %.loc23_39.3: ref A = class_element_access %.loc23_39.2, element0
 // CHECK:STDOUT:   %.loc23_39.4: A* = addr_of %.loc23_39.3
-// CHECK:STDOUT:   %.loc23_39.5: A* = converted %p.ref, %.loc23_39.4
-// CHECK:STDOUT:   return %.loc23_39.5
+// CHECK:STDOUT:   %.loc23_38: A* = converted %p.ref, %.loc23_39.4
+// CHECK:STDOUT:   return %.loc23_38
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @ConvertValue(%c: C) {
@@ -144,32 +144,32 @@ fn ConvertInit() {
 // CHECK:STDOUT:   %c.ref: C = name_ref c, %c
 // CHECK:STDOUT:   %.loc26_15.1: ref B = class_element_access %c.ref, element0
 // CHECK:STDOUT:   %.loc26_15.2: ref A = class_element_access %.loc26_15.1, element0
-// CHECK:STDOUT:   %.loc26_15.3: ref A = converted %c.ref, %.loc26_15.2
-// CHECK:STDOUT:   %.loc26_15.4: A = bind_value %.loc26_15.3
-// CHECK:STDOUT:   %a: A = bind_name a, %.loc26_15.4
+// CHECK:STDOUT:   %.loc26_14.1: ref A = converted %c.ref, %.loc26_15.2
+// CHECK:STDOUT:   %.loc26_14.2: A = bind_value %.loc26_14.1
+// CHECK:STDOUT:   %a: A = bind_name a, %.loc26_14.2
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @ConvertRef(%c: C*) -> A* {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %c.ref: C* = name_ref c, %c
-// CHECK:STDOUT:   %.loc30_12: ref C = deref %c.ref
+// CHECK:STDOUT:   %.loc30_12.1: ref C = deref %c.ref
 // CHECK:STDOUT:   %A.ref: type = name_ref A, file.%A [template = file.%A]
-// CHECK:STDOUT:   %.loc30_15.1: ref B = class_element_access %.loc30_12, element0
+// CHECK:STDOUT:   %.loc30_15.1: ref B = class_element_access %.loc30_12.1, element0
 // CHECK:STDOUT:   %.loc30_15.2: ref A = class_element_access %.loc30_15.1, element0
-// CHECK:STDOUT:   %.loc30_15.3: ref A = converted %.loc30_12, %.loc30_15.2
-// CHECK:STDOUT:   %.loc30_10: A* = addr_of %.loc30_15.3
+// CHECK:STDOUT:   %.loc30_12.2: ref A = converted %.loc30_12.1, %.loc30_15.2
+// CHECK:STDOUT:   %.loc30_10: A* = addr_of %.loc30_12.2
 // CHECK:STDOUT:   return %.loc30_10
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @ConvertInit() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %A.ref: type = name_ref A, file.%A [template = file.%A]
-// CHECK:STDOUT:   %.loc34_38: i32 = int_literal 1 [template = constants.%.loc34_38]
+// CHECK:STDOUT:   %.loc34_38: i32 = int_literal 1 [template = constants.%.11]
 // CHECK:STDOUT:   %.loc34_39.1: {.a: i32} = struct_literal (%.loc34_38)
-// CHECK:STDOUT:   %.loc34_47: i32 = int_literal 2 [template = constants.%.loc34_47]
+// CHECK:STDOUT:   %.loc34_47: i32 = int_literal 2 [template = constants.%.12]
 // CHECK:STDOUT:   %.loc34_48.1: {.base: {.a: i32}, .b: i32} = struct_literal (%.loc34_39.1, %.loc34_47)
-// CHECK:STDOUT:   %.loc34_56: i32 = int_literal 3 [template = constants.%.loc34_56]
+// CHECK:STDOUT:   %.loc34_56: i32 = int_literal 3 [template = constants.%.14]
 // CHECK:STDOUT:   %.loc34_57.1: {.base: {.base: {.a: i32}, .b: i32}, .c: i32} = struct_literal (%.loc34_48.1, %.loc34_56)
 // CHECK:STDOUT:   %C.ref: type = name_ref C, file.%C [template = file.%C]
 // CHECK:STDOUT:   %.loc34_57.2: ref C = temporary_storage
@@ -190,9 +190,9 @@ fn ConvertInit() {
 // CHECK:STDOUT:   %.loc34_57.8: ref C = converted %.loc34_57.1, %.loc34_57.7
 // CHECK:STDOUT:   %.loc34_63.1: ref B = class_element_access %.loc34_57.8, element0
 // CHECK:STDOUT:   %.loc34_63.2: ref A = class_element_access %.loc34_63.1, element0
-// CHECK:STDOUT:   %.loc34_63.3: ref A = converted %.loc34_57.8, %.loc34_63.2
-// CHECK:STDOUT:   %.loc34_63.4: A = bind_value %.loc34_63.3
-// CHECK:STDOUT:   %a: A = bind_name a, %.loc34_63.4
+// CHECK:STDOUT:   %.loc34_57.9: ref A = converted %.loc34_57.8, %.loc34_63.2
+// CHECK:STDOUT:   %.loc34_57.10: A = bind_value %.loc34_57.9
+// CHECK:STDOUT:   %a: A = bind_name a, %.loc34_57.10
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 14 - 14
toolchain/check/testdata/class/fail_abstract.carbon

@@ -29,18 +29,18 @@ fn Access(d: Derived) -> (i32, i32) {
 // CHECK:STDOUT: --- fail_abstract.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.1: type = struct_type {.base: Abstract, .d: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.2: type = struct_type {.base: {.a: i32}*, .d: i32} [template]
-// CHECK:STDOUT:   %.loc15_1.3: type = ptr_type {.base: {.a: i32}*, .d: i32} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.base: Abstract, .d: i32} [template]
-// CHECK:STDOUT:   %.loc22_25: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc22_34: i32 = int_literal 7 [template]
-// CHECK:STDOUT:   %.loc22_35: type = struct_type {.base: {.a: i32}, .d: i32} [template]
-// CHECK:STDOUT:   %.loc25_35.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc25_35.2: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc25_35.3: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: Abstract, .d: i32} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: {.a: i32}*, .d: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.base: {.a: i32}*, .d: i32} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: Abstract, .d: i32} [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 7 [template]
+// CHECK:STDOUT:   %.9: type = struct_type {.base: {.a: i32}, .d: i32} [template]
+// CHECK:STDOUT:   %.10: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.11: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.12: type = ptr_type (i32, i32) [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -78,9 +78,9 @@ fn Access(d: Derived) -> (i32, i32) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Make() -> %return: Derived {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc22_25: i32 = int_literal 1 [template = constants.%.loc22_25]
+// CHECK:STDOUT:   %.loc22_25: i32 = int_literal 1 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc22_26: {.a: i32} = struct_literal (%.loc22_25)
-// CHECK:STDOUT:   %.loc22_34: i32 = int_literal 7 [template = constants.%.loc22_34]
+// CHECK:STDOUT:   %.loc22_34: i32 = int_literal 7 [template = constants.%.8]
 // CHECK:STDOUT:   %.loc22_35: {.base: {.a: i32}, .d: i32} = struct_literal (%.loc22_26, %.loc22_34)
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/check/testdata/class/fail_addr_not_self.carbon

@@ -19,7 +19,7 @@ class Class {
 // CHECK:STDOUT: --- fail_addr_not_self.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc17: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 3 - 3
toolchain/check/testdata/class/fail_addr_self.carbon

@@ -41,9 +41,9 @@ fn F(c: Class, p: Class*) {
 // CHECK:STDOUT: --- fail_addr_self.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 29 - 29
toolchain/check/testdata/class/fail_base_bad_type.carbon

@@ -120,21 +120,21 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: --- fail_base_bad_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_18.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc10: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc17: type = struct_type {.base: <error>} [template]
-// CHECK:STDOUT:   %.loc12: type = ptr_type {.base: <error>} [template]
-// CHECK:STDOUT:   %.loc26: i32 = int_literal 32 [template]
-// CHECK:STDOUT:   %.loc51_22: type = tuple_type (type) [template]
-// CHECK:STDOUT:   %.loc51_23.1: type = tuple_type (Base) [template]
-// CHECK:STDOUT:   %.loc7_18.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7_17: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc51_23.2: type = tuple_type ({}*) [template]
-// CHECK:STDOUT:   %.loc67: type = ptr_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc8: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc102_1.1: type = struct_type {.base: Final} [template]
-// CHECK:STDOUT:   %.loc102_1.2: type = struct_type {.base: {.a: i32}*} [template]
-// CHECK:STDOUT:   %.loc97: type = ptr_type {.base: Final} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: <error>} [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {.base: <error>} [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 32 [template]
+// CHECK:STDOUT:   %.6: type = tuple_type (type) [template]
+// CHECK:STDOUT:   %.7: type = tuple_type (Base) [template]
+// CHECK:STDOUT:   %.8: type = tuple_type () [template]
+// CHECK:STDOUT:   %.9: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.10: type = tuple_type ({}*) [template]
+// CHECK:STDOUT:   %.11: type = ptr_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.12: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.13: type = struct_type {.base: Final} [template]
+// CHECK:STDOUT:   %.14: type = struct_type {.base: {.a: i32}*} [template]
+// CHECK:STDOUT:   %.15: type = ptr_type {.base: Final} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -199,7 +199,7 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @DeriveFromNonType {
-// CHECK:STDOUT:   %.loc26_16: i32 = int_literal 32 [template = constants.%.loc26]
+// CHECK:STDOUT:   %.loc26_16: i32 = int_literal 32 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc26_18.1: type = unbound_element_type DeriveFromNonType, <error> [template]
 // CHECK:STDOUT:   %.loc26_18.2: <unbound element of class DeriveFromNonType> = base_decl <error>, element0 [template]
 // CHECK:STDOUT:
@@ -219,13 +219,13 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: class @DeriveFromTuple {
 // CHECK:STDOUT:   %Base.ref: type = name_ref Base, file.%Base [template = file.%Base]
-// CHECK:STDOUT:   %.loc51_22: (type,) = tuple_literal (%Base.ref)
-// CHECK:STDOUT:   %.loc51_23.1: type = converted %.loc51_22, constants.%.loc51_23.1 [template = constants.%.loc51_23.1]
-// CHECK:STDOUT:   %.loc51_23.2: type = unbound_element_type DeriveFromTuple, <error> [template]
-// CHECK:STDOUT:   %.loc51_23.3: <unbound element of class DeriveFromTuple> = base_decl <error>, element0 [template]
+// CHECK:STDOUT:   %.loc51_22.1: (type,) = tuple_literal (%Base.ref)
+// CHECK:STDOUT:   %.loc51_22.2: type = converted %.loc51_22.1, constants.%.7 [template = constants.%.7]
+// CHECK:STDOUT:   %.loc51_23.1: type = unbound_element_type DeriveFromTuple, <error> [template]
+// CHECK:STDOUT:   %.loc51_23.2: <unbound element of class DeriveFromTuple> = base_decl <error>, element0 [template]
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .base = %.loc51_23.3
+// CHECK:STDOUT:   .base = %.loc51_23.2
 // CHECK:STDOUT:   has_error
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -339,19 +339,19 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT:   %.loc106_11.1: ref DeriveFromFinal = deref %p.ref
 // CHECK:STDOUT:   %.loc106_11.2: ref Final = class_element_access %.loc106_11.1, element0
 // CHECK:STDOUT:   %.loc106_11.3: Final* = addr_of %.loc106_11.2
-// CHECK:STDOUT:   %.loc106_11.4: Final* = converted %p.ref, %.loc106_11.3
-// CHECK:STDOUT:   return %.loc106_11.4
+// CHECK:STDOUT:   %.loc106_10: Final* = converted %p.ref, %.loc106_11.3
+// CHECK:STDOUT:   return %.loc106_10
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_WithMember(%p: DeriveFromFinal*) -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %p.ref: DeriveFromFinal* = name_ref p, %p
-// CHECK:STDOUT:   %.loc110_11: ref DeriveFromFinal = deref %p.ref
-// CHECK:STDOUT:   %.loc110_14.1: ref Final = class_element_access %.loc110_11, element0
-// CHECK:STDOUT:   %.loc110_14.2: ref Final = converted %.loc110_11, %.loc110_14.1
-// CHECK:STDOUT:   %.loc110_14.3: ref i32 = class_element_access %.loc110_14.2, element0
-// CHECK:STDOUT:   %.loc110_14.4: i32 = bind_value %.loc110_14.3
-// CHECK:STDOUT:   return %.loc110_14.4
+// CHECK:STDOUT:   %.loc110_11.1: ref DeriveFromFinal = deref %p.ref
+// CHECK:STDOUT:   %.loc110_14.1: ref Final = class_element_access %.loc110_11.1, element0
+// CHECK:STDOUT:   %.loc110_11.2: ref Final = converted %.loc110_11.1, %.loc110_14.1
+// CHECK:STDOUT:   %.loc110_14.2: ref i32 = class_element_access %.loc110_11.2, element0
+// CHECK:STDOUT:   %.loc110_14.3: i32 = bind_value %.loc110_14.2
+// CHECK:STDOUT:   return %.loc110_14.3
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @AccessMemberWithInvalidBaseFinal_NoMember(%p: DeriveFromFinal*) -> i32 {

+ 4 - 4
toolchain/check/testdata/class/fail_base_method_define.carbon

@@ -29,10 +29,10 @@ fn D.C.F() {}
 // CHECK:STDOUT: --- fail_base_method_define.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12_3.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc12_3.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc17: type = struct_type {.base: B} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: B} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_base_misplaced.carbon

@@ -24,7 +24,7 @@ fn F() {
 // CHECK:STDOUT: --- fail_base_misplaced.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 4 - 4
toolchain/check/testdata/class/fail_base_modifiers.carbon

@@ -46,10 +46,10 @@ class C4 {
 // CHECK:STDOUT: --- fail_base_modifiers.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_15.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc7_15.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7_14: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc14: type = struct_type {.base: B} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: B} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 4 - 4
toolchain/check/testdata/class/fail_base_no_extend.carbon

@@ -16,10 +16,10 @@ class C {
 // CHECK:STDOUT: --- fail_base_no_extend.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_15.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc7_15.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7_14: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc14: type = struct_type {.base: B} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: B} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 4 - 4
toolchain/check/testdata/class/fail_base_repeated.carbon

@@ -33,10 +33,10 @@ class D {
 // CHECK:STDOUT: --- fail_base_repeated.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_16.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc7_16.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7_15: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc19: type = struct_type {.base: B1} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: B1} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 4 - 4
toolchain/check/testdata/class/fail_base_unbound.carbon

@@ -18,10 +18,10 @@ let b: B = C.base;
 // CHECK:STDOUT: --- fail_base_unbound.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_15.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc7_15.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7_14: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc11: type = struct_type {.base: B} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: B} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 6 - 6
toolchain/check/testdata/class/fail_derived_to_base.carbon

@@ -32,12 +32,12 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; }
 // CHECK:STDOUT: --- fail_derived_to_base.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.1: type = struct_type {.base: A2, .b: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.2: type = struct_type {.base: {.a: i32}*, .b: i32} [template]
-// CHECK:STDOUT:   %.loc18_1.3: type = ptr_type {.base: {.a: i32}*, .b: i32} [template]
-// CHECK:STDOUT:   %.loc15: type = ptr_type {.base: A2, .b: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: A2, .b: i32} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.base: {.a: i32}*, .b: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.base: {.a: i32}*, .b: i32} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: A2, .b: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 5 - 5
toolchain/check/testdata/class/fail_field_modifiers.carbon

@@ -30,9 +30,9 @@ class Class {
 // CHECK:STDOUT: --- fail_field_modifiers.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc22: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc27: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc28: type = struct_type {.j: i32, .k: i32} [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.j: i32, .k: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -48,9 +48,9 @@ class Class {
 // CHECK:STDOUT:   %.loc17_14.1: type = unbound_element_type Class, i32 [template]
 // CHECK:STDOUT:   %.loc17_14.2: <unbound element of class Class> = field_decl k, element1 [template]
 // CHECK:STDOUT:   %k: <unbound element of class Class> = bind_name k, %.loc17_14.2 [template = %.loc17_14.2]
-// CHECK:STDOUT:   %.loc22: i32 = int_literal 0 [template = constants.%.loc22]
+// CHECK:STDOUT:   %.loc22: i32 = int_literal 0 [template = constants.%.1]
 // CHECK:STDOUT:   %l: i32 = bind_name l, %.loc22
-// CHECK:STDOUT:   %.loc27: i32 = int_literal 1 [template = constants.%.loc27]
+// CHECK:STDOUT:   %.loc27: i32 = int_literal 1 [template = constants.%.2]
 // CHECK:STDOUT:   %m: i32 = bind_name m, %.loc27
 // CHECK:STDOUT:
 // CHECK:STDOUT: !members:

+ 2 - 2
toolchain/check/testdata/class/fail_incomplete.carbon

@@ -118,8 +118,8 @@ fn CallReturnIncomplete() {
 // CHECK:STDOUT: --- fail_incomplete.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc41: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc100: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 17 - 17
toolchain/check/testdata/class/fail_init.carbon

@@ -27,17 +27,17 @@ fn F() {
 // CHECK:STDOUT: --- fail_init.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc16_9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc16_10: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc20_9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc20_17: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc20_18: type = struct_type {.a: i32, .c: i32} [template]
-// CHECK:STDOUT:   %.loc24_9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc24_17: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc24_25: i32 = int_literal 3 [template]
-// CHECK:STDOUT:   %.loc24_26: type = struct_type {.a: i32, .b: i32, .c: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.7: type = struct_type {.a: i32, .c: i32} [template]
+// CHECK:STDOUT:   %.8: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.9: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.10: i32 = int_literal 3 [template]
+// CHECK:STDOUT:   %.11: type = struct_type {.a: i32, .b: i32, .c: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -62,14 +62,14 @@ fn F() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc16_9: i32 = int_literal 1 [template = constants.%.loc16_9]
+// CHECK:STDOUT:   %.loc16_9: i32 = int_literal 1 [template = constants.%.2]
 // CHECK:STDOUT:   %.loc16_10.1: {.a: i32} = struct_literal (%.loc16_9)
 // CHECK:STDOUT:   %Class.ref.loc16: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc16_10.2: ref Class = temporary_storage
 // CHECK:STDOUT:   %.loc16_10.3: ref Class = temporary %.loc16_10.2, <error>
 // CHECK:STDOUT:   %.loc16_10.4: ref Class = converted %.loc16_10.1, %.loc16_10.3
-// CHECK:STDOUT:   %.loc20_9: i32 = int_literal 1 [template = constants.%.loc20_9]
-// CHECK:STDOUT:   %.loc20_17: i32 = int_literal 2 [template = constants.%.loc20_17]
+// CHECK:STDOUT:   %.loc20_9: i32 = int_literal 1 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc20_17: i32 = int_literal 2 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc20_18.1: {.a: i32, .c: i32} = struct_literal (%.loc20_9, %.loc20_17)
 // CHECK:STDOUT:   %Class.ref.loc20: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc20_18.2: ref Class = temporary_storage
@@ -77,9 +77,9 @@ fn F() {
 // CHECK:STDOUT:   %.loc20_18.4: init i32 = initialize_from %.loc20_9 to %.loc20_18.3
 // CHECK:STDOUT:   %.loc20_18.5: ref Class = temporary %.loc20_18.2, <error>
 // CHECK:STDOUT:   %.loc20_18.6: ref Class = converted %.loc20_18.1, %.loc20_18.5
-// CHECK:STDOUT:   %.loc24_9: i32 = int_literal 1 [template = constants.%.loc24_9]
-// CHECK:STDOUT:   %.loc24_17: i32 = int_literal 2 [template = constants.%.loc24_17]
-// CHECK:STDOUT:   %.loc24_25: i32 = int_literal 3 [template = constants.%.loc24_25]
+// CHECK:STDOUT:   %.loc24_9: i32 = int_literal 1 [template = constants.%.8]
+// CHECK:STDOUT:   %.loc24_17: i32 = int_literal 2 [template = constants.%.9]
+// CHECK:STDOUT:   %.loc24_25: i32 = int_literal 3 [template = constants.%.10]
 // CHECK:STDOUT:   %.loc24_26.1: {.a: i32, .b: i32, .c: i32} = struct_literal (%.loc24_9, %.loc24_17, %.loc24_25)
 // CHECK:STDOUT:   %Class.ref.loc24: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc24_26.2: ref Class = temporary_storage

+ 7 - 7
toolchain/check/testdata/class/fail_init_as_inplace.carbon

@@ -25,11 +25,11 @@ fn F() {
 // CHECK:STDOUT: --- fail_init_as_inplace.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc21_24: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc21_32: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc22: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.5: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -60,8 +60,8 @@ fn F() {
 // CHECK:STDOUT:   %Class.ref.loc21_10: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %c.var: ref Class = var c
 // CHECK:STDOUT:   %c: ref Class = bind_name c, %c.var
-// CHECK:STDOUT:   %.loc21_24: i32 = int_literal 1 [template = constants.%.loc21_24]
-// CHECK:STDOUT:   %.loc21_32: i32 = int_literal 2 [template = constants.%.loc21_32]
+// CHECK:STDOUT:   %.loc21_24: i32 = int_literal 1 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc21_32: i32 = int_literal 2 [template = constants.%.4]
 // CHECK:STDOUT:   %.loc21_33.1: {.a: i32, .b: i32} = struct_literal (%.loc21_24, %.loc21_32)
 // CHECK:STDOUT:   %Class.ref.loc21_38: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc21_33.2: ref Class = temporary_storage

+ 6 - 6
toolchain/check/testdata/class/fail_memaccess_category.carbon

@@ -36,12 +36,12 @@ fn F(s: {.a: A}, b: B) {
 // CHECK:STDOUT: --- fail_memaccess_category.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc9_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
-// CHECK:STDOUT:   %.loc13_1.1: type = struct_type {.a: A} [template]
-// CHECK:STDOUT:   %.loc13_1.2: type = struct_type {.a: {}*} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.a: A} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.a: A} [template]
+// CHECK:STDOUT:   %.5: type = struct_type {.a: {}*} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.a: A} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_member_of_let.carbon

@@ -21,7 +21,7 @@ fn T.F() {}
 // CHECK:STDOUT: --- fail_member_of_let.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 3 - 3
toolchain/check/testdata/class/fail_method.carbon

@@ -33,9 +33,9 @@ fn F(c: Class) {
 // CHECK:STDOUT: --- fail_method.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_method_modifiers.carbon

@@ -50,7 +50,7 @@ base class BaseClass {
 // CHECK:STDOUT: --- fail_method_modifiers.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc24: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_modifiers.carbon

@@ -67,7 +67,7 @@ abstract base class AbstractAndBase {}
 // CHECK:STDOUT: --- fail_modifiers.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc27: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_out_of_line_decl.carbon

@@ -14,7 +14,7 @@ fn C.F() {}
 // CHECK:STDOUT: --- fail_out_of_line_decl.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_redeclaration_introducer.carbon

@@ -77,7 +77,7 @@ base class G;
 // CHECK:STDOUT: --- fail_redeclaration_introducer.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc14: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_redeclaration_scope.carbon

@@ -24,7 +24,7 @@ class Y {
 // CHECK:STDOUT: --- fail_redeclaration_scope.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_redefinition.carbon

@@ -27,7 +27,7 @@ fn Class.H() {}
 // CHECK:STDOUT: --- fail_redefinition.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 3 - 3
toolchain/check/testdata/class/fail_reorder.carbon

@@ -28,8 +28,8 @@ class Class {
 // CHECK:STDOUT: --- fail_reorder.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc24: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc26: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -56,7 +56,7 @@ class Class {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc24: i32 = int_literal 1 [template = constants.%.loc24]
+// CHECK:STDOUT:   %.loc24: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc24
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 3 - 3
toolchain/check/testdata/class/fail_scope.carbon

@@ -20,8 +20,8 @@ fn G() -> i32 {
 // CHECK:STDOUT: --- fail_scope.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc11: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -40,7 +40,7 @@ fn G() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template = constants.%.loc9]
+// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc9
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 3 - 3
toolchain/check/testdata/class/fail_self.carbon

@@ -53,9 +53,9 @@ fn CallWrongSelf(ws: WrongSelf) {
 // CHECK:STDOUT: --- fail_self.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc20_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc20_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 2 - 2
toolchain/check/testdata/class/fail_todo_modifiers.carbon

@@ -61,8 +61,8 @@ abstract class Abstract {
 // CHECK:STDOUT: --- fail_todo_modifiers.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc28: type = struct_type {.k: i32, .l: i32} [template]
-// CHECK:STDOUT:   %.loc41: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.k: i32, .l: i32} [template]
+// CHECK:STDOUT:   %.2: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/fail_unbound_field.carbon

@@ -24,7 +24,7 @@ fn G() -> i32 {
 // CHECK:STDOUT: --- fail_unbound_field.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc15: type = struct_type {.field: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.field: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 2 - 2
toolchain/check/testdata/class/fail_unknown_member.carbon

@@ -19,8 +19,8 @@ fn G(c: Class) -> i32 {
 // CHECK:STDOUT: --- fail_unknown_member.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.n: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.n: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.n: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.n: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 6 - 6
toolchain/check/testdata/class/field_access.carbon

@@ -20,10 +20,10 @@ fn Run() {
 // CHECK:STDOUT: --- field_access.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.j: i32, .k: i32} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.j: i32, .k: i32} [template]
-// CHECK:STDOUT:   %.loc14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc15: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.j: i32, .k: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.j: i32, .k: i32} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -53,11 +53,11 @@ fn Run() {
 // CHECK:STDOUT:   %c: ref Class = bind_name c, %c.var
 // CHECK:STDOUT:   %c.ref.loc14: ref Class = name_ref c, %c
 // CHECK:STDOUT:   %.loc14_4: ref i32 = class_element_access %c.ref.loc14, element0
-// CHECK:STDOUT:   %.loc14_9: i32 = int_literal 1 [template = constants.%.loc14]
+// CHECK:STDOUT:   %.loc14_9: i32 = int_literal 1 [template = constants.%.3]
 // CHECK:STDOUT:   assign %.loc14_4, %.loc14_9
 // CHECK:STDOUT:   %c.ref.loc15: ref Class = name_ref c, %c
 // CHECK:STDOUT:   %.loc15_4: ref i32 = class_element_access %c.ref.loc15, element1
-// CHECK:STDOUT:   %.loc15_9: i32 = int_literal 2 [template = constants.%.loc15]
+// CHECK:STDOUT:   %.loc15_9: i32 = int_literal 2 [template = constants.%.4]
 // CHECK:STDOUT:   assign %.loc15_4, %.loc15_9
 // CHECK:STDOUT:   %cj.var: ref i32 = var cj
 // CHECK:STDOUT:   %cj: ref i32 = bind_name cj, %cj.var

+ 6 - 6
toolchain/check/testdata/class/field_access_in_value.carbon

@@ -21,10 +21,10 @@ fn Test() {
 // CHECK:STDOUT: --- field_access_in_value.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.j: i32, .k: i32} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.j: i32, .k: i32} [template]
-// CHECK:STDOUT:   %.loc14: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc15: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.j: i32, .k: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.j: i32, .k: i32} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 2 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -54,11 +54,11 @@ fn Test() {
 // CHECK:STDOUT:   %cv: ref Class = bind_name cv, %cv.var
 // CHECK:STDOUT:   %cv.ref.loc14: ref Class = name_ref cv, %cv
 // CHECK:STDOUT:   %.loc14_5: ref i32 = class_element_access %cv.ref.loc14, element0
-// CHECK:STDOUT:   %.loc14_10: i32 = int_literal 1 [template = constants.%.loc14]
+// CHECK:STDOUT:   %.loc14_10: i32 = int_literal 1 [template = constants.%.3]
 // CHECK:STDOUT:   assign %.loc14_5, %.loc14_10
 // CHECK:STDOUT:   %cv.ref.loc15: ref Class = name_ref cv, %cv
 // CHECK:STDOUT:   %.loc15_5: ref i32 = class_element_access %cv.ref.loc15, element1
-// CHECK:STDOUT:   %.loc15_10: i32 = int_literal 2 [template = constants.%.loc15]
+// CHECK:STDOUT:   %.loc15_10: i32 = int_literal 2 [template = constants.%.4]
 // CHECK:STDOUT:   assign %.loc15_5, %.loc15_10
 // CHECK:STDOUT:   %Class.ref.loc16: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %cv.ref.loc16: ref Class = name_ref cv, %cv

+ 3 - 3
toolchain/check/testdata/class/init.carbon

@@ -20,9 +20,9 @@ fn MakeReorder(n: i32, next: Class*) -> Class {
 // CHECK:STDOUT: --- init.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.n: i32, .next: Class*} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.n: i32, .next: Class*} [template]
-// CHECK:STDOUT:   %.loc17: type = struct_type {.next: Class*, .n: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.n: i32, .next: Class*} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.n: i32, .next: Class*} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.next: Class*, .n: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 6 - 6
toolchain/check/testdata/class/init_as.carbon

@@ -16,10 +16,10 @@ fn F() -> i32 {
 // CHECK:STDOUT: --- init_as.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc13_17: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc13_25: i32 = int_literal 2 [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.2: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {.a: i32, .b: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -44,8 +44,8 @@ fn F() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc13_17: i32 = int_literal 1 [template = constants.%.loc13_17]
-// CHECK:STDOUT:   %.loc13_25: i32 = int_literal 2 [template = constants.%.loc13_25]
+// CHECK:STDOUT:   %.loc13_17: i32 = int_literal 1 [template = constants.%.2]
+// CHECK:STDOUT:   %.loc13_25: i32 = int_literal 2 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc13_26.1: {.a: i32, .b: i32} = struct_literal (%.loc13_17, %.loc13_25)
 // CHECK:STDOUT:   %Class.ref: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc13_26.2: ref Class = temporary_storage

+ 6 - 6
toolchain/check/testdata/class/init_nested.carbon

@@ -23,12 +23,12 @@ fn MakeOuter() -> Outer {
 // CHECK:STDOUT: --- init_nested.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_1.1: type = struct_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc10_1.2: type = ptr_type {.a: i32, .b: i32} [template]
-// CHECK:STDOUT:   %.loc17_1.1: type = struct_type {.c: Inner, .d: Inner} [template]
-// CHECK:STDOUT:   %.loc17_1.2: type = struct_type {.c: {.a: i32, .b: i32}*, .d: {.a: i32, .b: i32}*} [template]
-// CHECK:STDOUT:   %.loc17_1.3: type = ptr_type {.c: {.a: i32, .b: i32}*, .d: {.a: i32, .b: i32}*} [template]
-// CHECK:STDOUT:   %.loc14: type = ptr_type {.c: Inner, .d: Inner} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32, .b: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.c: Inner, .d: Inner} [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.c: {.a: i32, .b: i32}*, .d: {.a: i32, .b: i32}*} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.c: {.a: i32, .b: i32}*, .d: {.a: i32, .b: i32}*} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.c: Inner, .d: Inner} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 32 - 32
toolchain/check/testdata/class/method.carbon

@@ -51,9 +51,9 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT: --- method.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12: type = struct_type {.k: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.k: i32} [template]
-// CHECK:STDOUT:   %.loc25: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.k: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.k: i32} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -98,15 +98,15 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %c.ref: Class = name_ref c, %c
 // CHECK:STDOUT:   %.loc21_11: <bound method> = bound_method %c.ref, @Class.%F
-// CHECK:STDOUT:   %.loc21_13: init i32 = call %.loc21_11(%c.ref)
-// CHECK:STDOUT:   %.loc21_15.1: i32 = value_of_initializer %.loc21_13
-// CHECK:STDOUT:   %.loc21_15.2: i32 = converted %.loc21_13, %.loc21_15.1
-// CHECK:STDOUT:   return %.loc21_15.2
+// CHECK:STDOUT:   %.loc21_13.1: init i32 = call %.loc21_11(%c.ref)
+// CHECK:STDOUT:   %.loc21_15: i32 = value_of_initializer %.loc21_13.1
+// CHECK:STDOUT:   %.loc21_13.2: i32 = converted %.loc21_13.1, %.loc21_15
+// CHECK:STDOUT:   return %.loc21_13.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallOnConstBoundMethod() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc25_17: i32 = int_literal 1 [template = constants.%.loc25]
+// CHECK:STDOUT:   %.loc25_17: i32 = int_literal 1 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc25_18.1: {.k: i32} = struct_literal (%.loc25_17)
 // CHECK:STDOUT:   %Class.ref: type = name_ref Class, file.%Class [template = file.%Class]
 // CHECK:STDOUT:   %.loc25_18.2: ref Class = temporary_storage
@@ -117,10 +117,10 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %.loc25_18.7: ref Class = converted %.loc25_18.1, %.loc25_18.6
 // CHECK:STDOUT:   %.loc25_29: <bound method> = bound_method %.loc25_18.7, @Class.%F
 // CHECK:STDOUT:   %.loc25_18.8: Class = bind_value %.loc25_18.7
-// CHECK:STDOUT:   %.loc25_31: init i32 = call %.loc25_29(%.loc25_18.8)
-// CHECK:STDOUT:   %.loc25_33.1: i32 = value_of_initializer %.loc25_31
-// CHECK:STDOUT:   %.loc25_33.2: i32 = converted %.loc25_31, %.loc25_33.1
-// CHECK:STDOUT:   return %.loc25_33.2
+// CHECK:STDOUT:   %.loc25_31.1: init i32 = call %.loc25_29(%.loc25_18.8)
+// CHECK:STDOUT:   %.loc25_33: i32 = value_of_initializer %.loc25_31.1
+// CHECK:STDOUT:   %.loc25_31.2: i32 = converted %.loc25_31.1, %.loc25_33
+// CHECK:STDOUT:   return %.loc25_31.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallWithAddr() -> i32 {
@@ -131,10 +131,10 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %c.ref: ref Class = name_ref c, %c
 // CHECK:STDOUT:   %.loc30_11: <bound method> = bound_method %c.ref, @Class.%G
 // CHECK:STDOUT:   %.loc30_10: Class* = addr_of %c.ref
-// CHECK:STDOUT:   %.loc30_13: init i32 = call %.loc30_11(%.loc30_10)
-// CHECK:STDOUT:   %.loc30_15.1: i32 = value_of_initializer %.loc30_13
-// CHECK:STDOUT:   %.loc30_15.2: i32 = converted %.loc30_13, %.loc30_15.1
-// CHECK:STDOUT:   return %.loc30_15.2
+// CHECK:STDOUT:   %.loc30_13.1: init i32 = call %.loc30_11(%.loc30_10)
+// CHECK:STDOUT:   %.loc30_15: i32 = value_of_initializer %.loc30_13.1
+// CHECK:STDOUT:   %.loc30_13.2: i32 = converted %.loc30_13.1, %.loc30_15
+// CHECK:STDOUT:   return %.loc30_13.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallFThroughPointer(%p: Class*) -> i32 {
@@ -143,10 +143,10 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %.loc34_11.1: ref Class = deref %p.ref
 // CHECK:STDOUT:   %.loc34_14: <bound method> = bound_method %.loc34_11.1, @Class.%F
 // CHECK:STDOUT:   %.loc34_11.2: Class = bind_value %.loc34_11.1
-// CHECK:STDOUT:   %.loc34_16: init i32 = call %.loc34_14(%.loc34_11.2)
-// CHECK:STDOUT:   %.loc34_18.1: i32 = value_of_initializer %.loc34_16
-// CHECK:STDOUT:   %.loc34_18.2: i32 = converted %.loc34_16, %.loc34_18.1
-// CHECK:STDOUT:   return %.loc34_18.2
+// CHECK:STDOUT:   %.loc34_16.1: init i32 = call %.loc34_14(%.loc34_11.2)
+// CHECK:STDOUT:   %.loc34_18: i32 = value_of_initializer %.loc34_16.1
+// CHECK:STDOUT:   %.loc34_16.2: i32 = converted %.loc34_16.1, %.loc34_18
+// CHECK:STDOUT:   return %.loc34_16.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallGThroughPointer(%p: Class*) -> i32 {
@@ -155,10 +155,10 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %.loc38_11.1: ref Class = deref %p.ref
 // CHECK:STDOUT:   %.loc38_14: <bound method> = bound_method %.loc38_11.1, @Class.%G
 // CHECK:STDOUT:   %.loc38_11.2: Class* = addr_of %.loc38_11.1
-// CHECK:STDOUT:   %.loc38_16: init i32 = call %.loc38_14(%.loc38_11.2)
-// CHECK:STDOUT:   %.loc38_18.1: i32 = value_of_initializer %.loc38_16
-// CHECK:STDOUT:   %.loc38_18.2: i32 = converted %.loc38_16, %.loc38_18.1
-// CHECK:STDOUT:   return %.loc38_18.2
+// CHECK:STDOUT:   %.loc38_16.1: init i32 = call %.loc38_14(%.loc38_11.2)
+// CHECK:STDOUT:   %.loc38_18: i32 = value_of_initializer %.loc38_16.1
+// CHECK:STDOUT:   %.loc38_16.2: i32 = converted %.loc38_16.1, %.loc38_18
+// CHECK:STDOUT:   return %.loc38_16.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Make() -> %return: Class;
@@ -171,10 +171,10 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %.loc44_14.3: ref Class = temporary %.loc44_14.1, %.loc44_14.2
 // CHECK:STDOUT:   %.loc44_16: <bound method> = bound_method %.loc44_14.3, @Class.%F
 // CHECK:STDOUT:   %.loc44_14.4: Class = bind_value %.loc44_14.3
-// CHECK:STDOUT:   %.loc44_18: init i32 = call %.loc44_16(%.loc44_14.4)
-// CHECK:STDOUT:   %.loc44_20.1: i32 = value_of_initializer %.loc44_18
-// CHECK:STDOUT:   %.loc44_20.2: i32 = converted %.loc44_18, %.loc44_20.1
-// CHECK:STDOUT:   return %.loc44_20.2
+// CHECK:STDOUT:   %.loc44_18.1: init i32 = call %.loc44_16(%.loc44_14.4)
+// CHECK:STDOUT:   %.loc44_20: i32 = value_of_initializer %.loc44_18.1
+// CHECK:STDOUT:   %.loc44_18.2: i32 = converted %.loc44_18.1, %.loc44_20
+// CHECK:STDOUT:   return %.loc44_18.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @CallGOnInitializingExpr() -> i32 {
@@ -185,9 +185,9 @@ fn CallGOnInitializingExpr() -> i32 {
 // CHECK:STDOUT:   %.loc48_14.3: ref Class = temporary %.loc48_14.1, %.loc48_14.2
 // CHECK:STDOUT:   %.loc48_16: <bound method> = bound_method %.loc48_14.3, @Class.%G
 // CHECK:STDOUT:   %.loc48_14.4: Class* = addr_of %.loc48_14.3
-// CHECK:STDOUT:   %.loc48_18: init i32 = call %.loc48_16(%.loc48_14.4)
-// CHECK:STDOUT:   %.loc48_20.1: i32 = value_of_initializer %.loc48_18
-// CHECK:STDOUT:   %.loc48_20.2: i32 = converted %.loc48_18, %.loc48_20.1
-// CHECK:STDOUT:   return %.loc48_20.2
+// CHECK:STDOUT:   %.loc48_18.1: init i32 = call %.loc48_16(%.loc48_14.4)
+// CHECK:STDOUT:   %.loc48_20: i32 = value_of_initializer %.loc48_18.1
+// CHECK:STDOUT:   %.loc48_18.2: i32 = converted %.loc48_18.1, %.loc48_20
+// CHECK:STDOUT:   return %.loc48_18.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 4 - 4
toolchain/check/testdata/class/nested.carbon

@@ -31,10 +31,10 @@ fn F(a: Outer*) {
 // CHECK:STDOUT: --- nested.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12_3.1: type = struct_type {.pi: Inner*, .po: Outer*, .qi: Inner*} [template]
-// CHECK:STDOUT:   %.loc17_1.1: type = struct_type {.po: Outer*, .qo: Outer*, .pi: Inner*} [template]
-// CHECK:STDOUT:   %.loc17_1.2: type = ptr_type {.po: Outer*, .qo: Outer*, .pi: Inner*} [template]
-// CHECK:STDOUT:   %.loc12_3.2: type = ptr_type {.pi: Inner*, .po: Outer*, .qi: Inner*} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.pi: Inner*, .po: Outer*, .qi: Inner*} [template]
+// CHECK:STDOUT:   %.2: type = struct_type {.po: Outer*, .qo: Outer*, .pi: Inner*} [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {.po: Outer*, .qo: Outer*, .pi: Inner*} [template]
+// CHECK:STDOUT:   %.4: type = ptr_type {.pi: Inner*, .po: Outer*, .qi: Inner*} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 5 - 5
toolchain/check/testdata/class/nested_name.carbon

@@ -21,11 +21,11 @@ fn G(o: Outer) {
 // CHECK:STDOUT: --- nested_name.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10: type = struct_type {.n: i32} [template]
-// CHECK:STDOUT:   %.loc11_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc8: type = ptr_type {.n: i32} [template]
-// CHECK:STDOUT:   %.loc11_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.n: i32} [template]
+// CHECK:STDOUT:   %.2: type = struct_type {} [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {.n: i32} [template]
+// CHECK:STDOUT:   %.4: type = tuple_type () [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 5 - 5
toolchain/check/testdata/class/raw_self.carbon

@@ -21,11 +21,11 @@ fn Class.G[self: Class](r#self: i32) -> (i32, i32) {
 // CHECK:STDOUT: --- raw_self.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_46.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc9_46.2: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc9_46.3: type = ptr_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc11: type = struct_type {.n: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.n: i32} [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.4: type = struct_type {.n: i32} [template]
+// CHECK:STDOUT:   %.5: type = ptr_type {.n: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/raw_self_type.carbon

@@ -14,7 +14,7 @@ class Class {
 // CHECK:STDOUT: --- raw_self_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/redeclaration.carbon

@@ -15,7 +15,7 @@ fn Class.F() {}
 // CHECK:STDOUT: --- redeclaration.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 1 - 1
toolchain/check/testdata/class/redeclaration_introducer.carbon

@@ -15,7 +15,7 @@ abstract class C {}
 // CHECK:STDOUT: --- redeclaration_introducer.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc11: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 5 - 5
toolchain/check/testdata/class/reenter_scope.carbon

@@ -16,7 +16,7 @@ fn Class.F() -> i32 {
 // CHECK:STDOUT: --- reenter_scope.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10: type = struct_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -38,10 +38,10 @@ fn Class.F() -> i32 {
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %G.ref: <function> = name_ref G, @Class.%G [template = @Class.%G]
-// CHECK:STDOUT:   %.loc13_11: init i32 = call %G.ref()
-// CHECK:STDOUT:   %.loc13_13.1: i32 = value_of_initializer %.loc13_11
-// CHECK:STDOUT:   %.loc13_13.2: i32 = converted %.loc13_11, %.loc13_13.1
-// CHECK:STDOUT:   return %.loc13_13.2
+// CHECK:STDOUT:   %.loc13_11.1: init i32 = call %G.ref()
+// CHECK:STDOUT:   %.loc13_13: i32 = value_of_initializer %.loc13_11.1
+// CHECK:STDOUT:   %.loc13_11.2: i32 = converted %.loc13_11.1, %.loc13_13
+// CHECK:STDOUT:   return %.loc13_11.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @G() -> i32;

+ 9 - 9
toolchain/check/testdata/class/scope.carbon

@@ -26,9 +26,9 @@ fn Run() {
 // CHECK:STDOUT: --- scope.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc15: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc18: i32 = int_literal 2 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = struct_type {} [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 2 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -50,22 +50,22 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F.1() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template = constants.%.loc9]
+// CHECK:STDOUT:   %.loc9: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc9
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @G() -> i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %F.ref: <function> = name_ref F, @Class.%F [template = @Class.%F]
-// CHECK:STDOUT:   %.loc13_13: init i32 = call %F.ref()
-// CHECK:STDOUT:   %.loc13_15.1: i32 = value_of_initializer %.loc13_13
-// CHECK:STDOUT:   %.loc13_15.2: i32 = converted %.loc13_13, %.loc13_15.1
-// CHECK:STDOUT:   return %.loc13_15.2
+// CHECK:STDOUT:   %.loc13_13.1: init i32 = call %F.ref()
+// CHECK:STDOUT:   %.loc13_15: i32 = value_of_initializer %.loc13_13.1
+// CHECK:STDOUT:   %.loc13_13.2: i32 = converted %.loc13_13.1, %.loc13_15
+// CHECK:STDOUT:   return %.loc13_13.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F.2() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc18: i32 = int_literal 2 [template = constants.%.loc18]
+// CHECK:STDOUT:   %.loc18: i32 = int_literal 2 [template = constants.%.3]
 // CHECK:STDOUT:   return %.loc18
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 2
toolchain/check/testdata/class/self.carbon

@@ -22,8 +22,8 @@ fn Class.G[addr self: Class*]() -> i32 {
 // CHECK:STDOUT: --- self.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12: type = struct_type {.n: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.n: i32} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.n: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.n: i32} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {

+ 19 - 19
toolchain/check/testdata/class/self_conversion.carbon

@@ -31,13 +31,13 @@ fn Call(p: Derived*) -> i32 {
 // CHECK:STDOUT: --- self_conversion.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9: type = struct_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.a: i32} [template]
-// CHECK:STDOUT:   %.loc16_1.1: type = struct_type {.base: Base} [template]
-// CHECK:STDOUT:   %.loc23: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc16_1.2: type = struct_type {.base: {.a: i32}*} [template]
-// CHECK:STDOUT:   %.loc11: type = ptr_type {.base: Base} [template]
-// CHECK:STDOUT:   %.loc27: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.a: i32} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.a: i32} [template]
+// CHECK:STDOUT:   %.3: type = struct_type {.base: Base} [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: type = struct_type {.base: {.a: i32}*} [template]
+// CHECK:STDOUT:   %.6: type = ptr_type {.base: Base} [template]
+// CHECK:STDOUT:   %.7: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -87,7 +87,7 @@ fn Call(p: Derived*) -> i32 {
 // CHECK:STDOUT:   %self.ref: Base* = name_ref self, %self
 // CHECK:STDOUT:   %.loc23_4: ref Base = deref %self.ref
 // CHECK:STDOUT:   %.loc23_10: ref i32 = class_element_access %.loc23_4, element0
-// CHECK:STDOUT:   %.loc23_15: i32 = int_literal 1 [template = constants.%.loc23]
+// CHECK:STDOUT:   %.loc23_15: i32 = int_literal 1 [template = constants.%.4]
 // CHECK:STDOUT:   assign %.loc23_10, %.loc23_15
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
@@ -101,17 +101,17 @@ fn Call(p: Derived*) -> i32 {
 // CHECK:STDOUT:   %.loc27_20.1: ref Derived = deref %.loc27_4.2
 // CHECK:STDOUT:   %.loc27_20.2: ref Base = class_element_access %.loc27_20.1, element0
 // CHECK:STDOUT:   %.loc27_20.3: Base* = addr_of %.loc27_20.2
-// CHECK:STDOUT:   %.loc27_20.4: Base* = converted %.loc27_4.2, %.loc27_20.3
-// CHECK:STDOUT:   %.loc27_20.5: init () = call %.loc27_7(%.loc27_20.4)
+// CHECK:STDOUT:   %.loc27_4.3: Base* = converted %.loc27_4.2, %.loc27_20.3
+// CHECK:STDOUT:   %.loc27_20.4: init () = call %.loc27_7(%.loc27_4.3)
 // CHECK:STDOUT:   %p.ref.loc28: Derived* = name_ref p, %p
-// CHECK:STDOUT:   %.loc28_11: ref Derived = deref %p.ref.loc28
-// CHECK:STDOUT:   %.loc28_14: <bound method> = bound_method %.loc28_11, @Derived.%SelfBase
-// CHECK:STDOUT:   %.loc28_23.1: ref Base = class_element_access %.loc28_11, element0
-// CHECK:STDOUT:   %.loc28_23.2: ref Base = converted %.loc28_11, %.loc28_23.1
-// CHECK:STDOUT:   %.loc28_23.3: Base = bind_value %.loc28_23.2
-// CHECK:STDOUT:   %.loc28_23.4: init i32 = call %.loc28_14(%.loc28_23.3)
-// CHECK:STDOUT:   %.loc28_25.1: i32 = value_of_initializer %.loc28_23.4
-// CHECK:STDOUT:   %.loc28_25.2: i32 = converted %.loc28_23.4, %.loc28_25.1
-// CHECK:STDOUT:   return %.loc28_25.2
+// CHECK:STDOUT:   %.loc28_11.1: ref Derived = deref %p.ref.loc28
+// CHECK:STDOUT:   %.loc28_14: <bound method> = bound_method %.loc28_11.1, @Derived.%SelfBase
+// CHECK:STDOUT:   %.loc28_23.1: ref Base = class_element_access %.loc28_11.1, element0
+// CHECK:STDOUT:   %.loc28_11.2: ref Base = converted %.loc28_11.1, %.loc28_23.1
+// CHECK:STDOUT:   %.loc28_11.3: Base = bind_value %.loc28_11.2
+// CHECK:STDOUT:   %.loc28_23.2: init i32 = call %.loc28_14(%.loc28_11.3)
+// CHECK:STDOUT:   %.loc28_25: i32 = value_of_initializer %.loc28_23.2
+// CHECK:STDOUT:   %.loc28_23.3: i32 = converted %.loc28_23.2, %.loc28_25
+// CHECK:STDOUT:   return %.loc28_23.3
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 6 - 6
toolchain/check/testdata/class/self_type.carbon

@@ -19,8 +19,8 @@ fn Class.F[self: Class]() -> i32 {
 // CHECK:STDOUT: --- self_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10: type = struct_type {.p: Class*} [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {.p: Class*} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {.p: Class*} [template]
+// CHECK:STDOUT:   %.2: type = ptr_type {.p: Class*} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -51,9 +51,9 @@ fn Class.F[self: Class]() -> i32 {
 // CHECK:STDOUT:   %.loc16_11.1: ref Class = deref %.loc16_16.2
 // CHECK:STDOUT:   %.loc16_19: <bound method> = bound_method %.loc16_11.1, @Class.%F
 // CHECK:STDOUT:   %.loc16_11.2: Class = bind_value %.loc16_11.1
-// CHECK:STDOUT:   %.loc16_21: init i32 = call %.loc16_19(%.loc16_11.2)
-// CHECK:STDOUT:   %.loc16_23.1: i32 = value_of_initializer %.loc16_21
-// CHECK:STDOUT:   %.loc16_23.2: i32 = converted %.loc16_21, %.loc16_23.1
-// CHECK:STDOUT:   return %.loc16_23.2
+// CHECK:STDOUT:   %.loc16_21.1: init i32 = call %.loc16_19(%.loc16_11.2)
+// CHECK:STDOUT:   %.loc16_23: i32 = value_of_initializer %.loc16_21.1
+// CHECK:STDOUT:   %.loc16_21.2: i32 = converted %.loc16_21.1, %.loc16_23
+// CHECK:STDOUT:   return %.loc16_21.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 7
toolchain/check/testdata/class/static_method.carbon

@@ -16,9 +16,9 @@ fn Run() -> i32 {
 // CHECK:STDOUT: --- static_method.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc9_1.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc9_1.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc7: type = ptr_type {} [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: type = ptr_type {} [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -44,9 +44,9 @@ fn Run() -> i32 {
 // CHECK:STDOUT:   %c: ref Class = bind_name c, %c.var
 // CHECK:STDOUT:   %c.ref: ref Class = name_ref c, %c
 // CHECK:STDOUT:   %F.ref: <function> = name_ref F, @Class.%F [template = @Class.%F]
-// CHECK:STDOUT:   %.loc13_13: init i32 = call %F.ref()
-// CHECK:STDOUT:   %.loc13_15.1: i32 = value_of_initializer %.loc13_13
-// CHECK:STDOUT:   %.loc13_15.2: i32 = converted %.loc13_13, %.loc13_15.1
-// CHECK:STDOUT:   return %.loc13_15.2
+// CHECK:STDOUT:   %.loc13_13.1: init i32 = call %F.ref()
+// CHECK:STDOUT:   %.loc13_15: i32 = value_of_initializer %.loc13_13.1
+// CHECK:STDOUT:   %.loc13_13.2: i32 = converted %.loc13_13.1, %.loc13_15
+// CHECK:STDOUT:   return %.loc13_13.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 7
toolchain/check/testdata/expr_category/in_place_tuple_init.carbon

@@ -19,10 +19,10 @@ fn H() -> i32 {
 // CHECK:STDOUT: --- in_place_tuple_init.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_20.1: type = tuple_type (type, type) [template]
-// CHECK:STDOUT:   %.loc7_20.2: type = tuple_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc7_20.3: type = ptr_type (i32, i32) [template]
-// CHECK:STDOUT:   %.loc16: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type, type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32, i32) [template]
+// CHECK:STDOUT:   %.3: type = ptr_type (i32, i32) [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 0 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -36,8 +36,8 @@ fn H() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @G() -> %return: (i32, i32) {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10_19: (type, type) = tuple_literal (i32, i32)
-// CHECK:STDOUT:   %.loc7: type = converted %.loc10_19, constants.%.loc7_20.2 [template = constants.%.loc7_20.2]
+// CHECK:STDOUT:   %.loc10_19.1: (type, type) = tuple_literal (i32, i32)
+// CHECK:STDOUT:   %.loc10_19.2: type = converted %.loc10_19.1, constants.%.2 [template = constants.%.2]
 // CHECK:STDOUT:   %v.var: ref (i32, i32) = var v
 // CHECK:STDOUT:   %v: ref (i32, i32) = bind_name v, %v.var
 // CHECK:STDOUT:   %F.ref.loc10: <function> = name_ref F, file.%F [template = file.%F]
@@ -60,7 +60,7 @@ fn H() -> i32 {
 // CHECK:STDOUT:   %G.ref: <function> = name_ref G, file.%G [template = file.%G]
 // CHECK:STDOUT:   %.loc16_11.1: ref (i32, i32) = temporary_storage
 // CHECK:STDOUT:   %.loc16_11.2: init (i32, i32) = call %G.ref() to %.loc16_11.1
-// CHECK:STDOUT:   %.loc16_14: i32 = int_literal 0 [template = constants.%.loc16]
+// CHECK:STDOUT:   %.loc16_14: i32 = int_literal 0 [template = constants.%.4]
 // CHECK:STDOUT:   %.loc16_11.3: ref (i32, i32) = temporary %.loc16_11.1, %.loc16_11.2
 // CHECK:STDOUT:   %.loc16_15.1: ref i32 = tuple_index %.loc16_11.3, %.loc16_14
 // CHECK:STDOUT:   %.loc16_15.2: i32 = bind_value %.loc16_15.1

+ 5 - 5
toolchain/check/testdata/function/call/empty_struct.carbon

@@ -15,9 +15,9 @@ fn Main() {
 // CHECK:STDOUT: --- empty_struct.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7_13.1: type = struct_type {} [template]
-// CHECK:STDOUT:   %.loc7_13.2: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc12: {} = struct_value () [template]
+// CHECK:STDOUT:   %.1: type = struct_type {} [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: {} = struct_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -36,8 +36,8 @@ fn Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
 // CHECK:STDOUT:   %.loc12_9.1: {} = struct_literal ()
-// CHECK:STDOUT:   %.loc12_9.2: {} = struct_value () [template = constants.%.loc12]
-// CHECK:STDOUT:   %.loc12_9.3: {} = converted %.loc12_9.1, %.loc12_9.2 [template = constants.%.loc12]
+// CHECK:STDOUT:   %.loc12_9.2: {} = struct_value () [template = constants.%.3]
+// CHECK:STDOUT:   %.loc12_9.3: {} = converted %.loc12_9.1, %.loc12_9.2 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc12_7: init {} = call %Echo.ref(%.loc12_9.3)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/check/testdata/function/call/empty_tuple.carbon

@@ -15,8 +15,8 @@ fn Main() {
 // CHECK:STDOUT: --- empty_tuple.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc12: () = tuple_value () [template]
+// CHECK:STDOUT:   %.1: type = tuple_type () [template]
+// CHECK:STDOUT:   %.2: () = tuple_value () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -35,8 +35,8 @@ fn Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
 // CHECK:STDOUT:   %.loc12_9.1: () = tuple_literal ()
-// CHECK:STDOUT:   %.loc12_9.2: () = tuple_value () [template = constants.%.loc12]
-// CHECK:STDOUT:   %.loc12_9.3: () = converted %.loc12_9.1, %.loc12_9.2 [template = constants.%.loc12]
+// CHECK:STDOUT:   %.loc12_9.2: () = tuple_value () [template = constants.%.2]
+// CHECK:STDOUT:   %.loc12_9.3: () = converted %.loc12_9.1, %.loc12_9.2 [template = constants.%.2]
 // CHECK:STDOUT:   %.loc12_7: init () = call %Echo.ref(%.loc12_9.3)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/check/testdata/function/call/fail_not_callable.carbon

@@ -15,7 +15,7 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %.1: type = ptr_type String [template]
-// CHECK:STDOUT:   %.loc11: String = string_literal "hello" [template]
+// CHECK:STDOUT:   %.2: String = string_literal "hello" [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -27,7 +27,7 @@ fn Run() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %x.var: ref i32 = var x
 // CHECK:STDOUT:   %x: ref i32 = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc11: String = string_literal "hello" [template = constants.%.loc11]
+// CHECK:STDOUT:   %.loc11: String = string_literal "hello" [template = constants.%.2]
 // CHECK:STDOUT:   assign %x.var, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 13 - 13
toolchain/check/testdata/function/call/fail_param_count.carbon

@@ -58,13 +58,13 @@ fn Main() {
 // CHECK:STDOUT: --- fail_param_count.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc18_8: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc18_7: type = tuple_type () [template]
-// CHECK:STDOUT:   %.loc25_8: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc25_11: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc40_8: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc40_11: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc55: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.6: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.7: i32 = int_literal 0 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -93,22 +93,22 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Run0.ref.loc18: <function> = name_ref Run0, file.%Run0 [template = file.%Run0]
-// CHECK:STDOUT:   %.loc18_8: i32 = int_literal 1 [template = constants.%.loc18_8]
+// CHECK:STDOUT:   %.loc18_8: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc18_7: init () = call %Run0.ref.loc18(<invalid>)
 // CHECK:STDOUT:   %Run0.ref.loc25: <function> = name_ref Run0, file.%Run0 [template = file.%Run0]
-// CHECK:STDOUT:   %.loc25_8: i32 = int_literal 0 [template = constants.%.loc25_8]
-// CHECK:STDOUT:   %.loc25_11: i32 = int_literal 1 [template = constants.%.loc25_11]
+// CHECK:STDOUT:   %.loc25_8: i32 = int_literal 0 [template = constants.%.3]
+// CHECK:STDOUT:   %.loc25_11: i32 = int_literal 1 [template = constants.%.4]
 // CHECK:STDOUT:   %.loc25_7: init () = call %Run0.ref.loc25(<invalid>)
 // CHECK:STDOUT:   %Run1.ref.loc33: <function> = name_ref Run1, file.%Run1 [template = file.%Run1]
 // CHECK:STDOUT:   %.loc33: init () = call %Run1.ref.loc33(<invalid>)
 // CHECK:STDOUT:   %Run1.ref.loc40: <function> = name_ref Run1, file.%Run1 [template = file.%Run1]
-// CHECK:STDOUT:   %.loc40_8: i32 = int_literal 0 [template = constants.%.loc40_8]
-// CHECK:STDOUT:   %.loc40_11: i32 = int_literal 1 [template = constants.%.loc40_11]
+// CHECK:STDOUT:   %.loc40_8: i32 = int_literal 0 [template = constants.%.5]
+// CHECK:STDOUT:   %.loc40_11: i32 = int_literal 1 [template = constants.%.6]
 // CHECK:STDOUT:   %.loc40_7: init () = call %Run1.ref.loc40(<invalid>)
 // CHECK:STDOUT:   %Run2.ref.loc48: <function> = name_ref Run2, file.%Run2 [template = file.%Run2]
 // CHECK:STDOUT:   %.loc48: init () = call %Run2.ref.loc48(<invalid>)
 // CHECK:STDOUT:   %Run2.ref.loc55: <function> = name_ref Run2, file.%Run2 [template = file.%Run2]
-// CHECK:STDOUT:   %.loc55_8: i32 = int_literal 0 [template = constants.%.loc55]
+// CHECK:STDOUT:   %.loc55_8: i32 = int_literal 0 [template = constants.%.7]
 // CHECK:STDOUT:   %.loc55_7: init () = call %Run2.ref.loc55(<invalid>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/check/testdata/function/call/fail_param_type.carbon

@@ -19,8 +19,8 @@ fn F() {
 // CHECK:STDOUT: --- fail_param_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc16_5: f64 = real_literal 10e-1 [template]
-// CHECK:STDOUT:   %.loc16_4: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: f64 = real_literal 10e-1 [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -37,7 +37,7 @@ fn F() {
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %G.ref: <function> = name_ref G, file.%G [template = file.%G]
-// CHECK:STDOUT:   %.loc16_5: f64 = real_literal 10e-1 [template = constants.%.loc16_5]
+// CHECK:STDOUT:   %.loc16_5: f64 = real_literal 10e-1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc16_4: init () = call %G.ref(<invalid>)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon

@@ -16,7 +16,7 @@ fn Run() {
 // CHECK:STDOUT: --- fail_return_type_mismatch.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc7: f64 = real_literal 10e-1 [template]
+// CHECK:STDOUT:   %.1: f64 = real_literal 10e-1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -27,7 +27,7 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Foo() -> f64 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc7: f64 = real_literal 10e-1 [template = constants.%.loc7]
+// CHECK:STDOUT:   %.loc7: f64 = real_literal 10e-1 [template = constants.%.1]
 // CHECK:STDOUT:   return %.loc7
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 2
toolchain/check/testdata/function/call/i32.carbon

@@ -15,7 +15,7 @@ fn Main() {
 // CHECK:STDOUT: --- i32.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc12: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -35,7 +35,7 @@ fn Main() {
 // CHECK:STDOUT:   %b.var: ref i32 = var b
 // CHECK:STDOUT:   %b: ref i32 = bind_name b, %b.var
 // CHECK:STDOUT:   %Echo.ref: <function> = name_ref Echo, file.%Echo [template = file.%Echo]
-// CHECK:STDOUT:   %.loc12_21: i32 = int_literal 1 [template = constants.%.loc12]
+// CHECK:STDOUT:   %.loc12_21: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc12_20: init i32 = call %Echo.ref(%.loc12_21)
 // CHECK:STDOUT:   assign %b.var, %.loc12_20
 // CHECK:STDOUT:   return

+ 10 - 10
toolchain/check/testdata/function/call/more_param_ir.carbon

@@ -15,12 +15,12 @@ fn Main() {
 // CHECK:STDOUT: --- more_param_ir.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_15.1: type = tuple_type (type) [template]
-// CHECK:STDOUT:   %.loc10_15.2: type = tuple_type (i32) [template]
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc12_9: i32 = int_literal 0 [template]
-// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 6 [template]
-// CHECK:STDOUT:   %.loc12_6: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: type = tuple_type (type) [template]
+// CHECK:STDOUT:   %.2: type = tuple_type (i32) [template]
+// CHECK:STDOUT:   %.3: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.4: i32 = int_literal 0 [template]
+// CHECK:STDOUT:   %.5: i32 = int_literal 6 [template]
+// CHECK:STDOUT:   %.6: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -37,19 +37,19 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc10_15.1: (type,) = tuple_literal (i32)
-// CHECK:STDOUT:   %.loc10_15.2: type = converted %.loc10_15.1, constants.%.loc10_15.2 [template = constants.%.loc10_15.2]
+// CHECK:STDOUT:   %.loc10_15.2: type = converted %.loc10_15.1, constants.%.2 [template = constants.%.2]
 // CHECK:STDOUT:   %x.var: ref (i32,) = var x
 // CHECK:STDOUT:   %x: ref (i32,) = bind_name x, %x.var
-// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.loc10_20]
+// CHECK:STDOUT:   %.loc10_20: i32 = int_literal 1 [template = constants.%.3]
 // CHECK:STDOUT:   %.loc10_22.1: (i32,) = tuple_literal (%.loc10_20)
 // CHECK:STDOUT:   %.loc10_22.2: init (i32,) = tuple_init (%.loc10_20) to %x.var
 // CHECK:STDOUT:   %.loc10_22.3: init (i32,) = converted %.loc10_22.1, %.loc10_22.2
 // CHECK:STDOUT:   assign %x.var, %.loc10_22.3
 // CHECK:STDOUT:   %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
 // CHECK:STDOUT:   %x.ref: ref (i32,) = name_ref x, %x
-// CHECK:STDOUT:   %.loc12_9: i32 = int_literal 0 [template = constants.%.loc12_9]
+// CHECK:STDOUT:   %.loc12_9: i32 = int_literal 0 [template = constants.%.4]
 // CHECK:STDOUT:   %.loc12_10.1: ref i32 = tuple_index %x.ref, %.loc12_9
-// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 6 [template = constants.%.loc12_13]
+// CHECK:STDOUT:   %.loc12_13: i32 = int_literal 6 [template = constants.%.5]
 // CHECK:STDOUT:   %.loc12_10.2: i32 = bind_value %.loc12_10.1
 // CHECK:STDOUT:   %.loc12_6: init () = call %Foo.ref(%.loc12_10.2, %.loc12_13)
 // CHECK:STDOUT:   return

+ 3 - 3
toolchain/check/testdata/function/call/params_one.carbon

@@ -13,8 +13,8 @@ fn Main() {
 // CHECK:STDOUT: --- params_one.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %.loc10_7: i32 = int_literal 1 [template]
-// CHECK:STDOUT:   %.loc10_6: type = tuple_type () [template]
+// CHECK:STDOUT:   %.1: i32 = int_literal 1 [template]
+// CHECK:STDOUT:   %.2: type = tuple_type () [template]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
@@ -31,7 +31,7 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Foo.ref: <function> = name_ref Foo, file.%Foo [template = file.%Foo]
-// CHECK:STDOUT:   %.loc10_7: i32 = int_literal 1 [template = constants.%.loc10_7]
+// CHECK:STDOUT:   %.loc10_7: i32 = int_literal 1 [template = constants.%.1]
 // CHECK:STDOUT:   %.loc10_6: init () = call %Foo.ref(%.loc10_7)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

Some files were not shown because too many files changed in this diff