Parcourir la source

Rename FloatLiteral to FloatValue. (#5911)

In preparation for `FloatValue` being used more generally, and not only
for literals.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Richard Smith il y a 9 mois
Parent
commit
4685890d63
24 fichiers modifiés avec 64 ajouts et 64 suppressions
  1. 6 6
      toolchain/check/eval.cpp
  2. 1 1
      toolchain/check/handle_literal.cpp
  3. 12 12
      toolchain/check/testdata/basics/numeric_literals.carbon
  4. 2 2
      toolchain/check/testdata/function/call/fail_param_type.carbon
  5. 2 2
      toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon
  6. 2 2
      toolchain/check/testdata/index/fail_array_non_int_indexing.carbon
  7. 2 2
      toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon
  8. 4 4
      toolchain/check/testdata/interop/cpp/function/param_unsupported.carbon
  9. 2 2
      toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon
  10. 2 2
      toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon
  11. 2 2
      toolchain/check/testdata/pointer/fail_address_of_value.carbon
  12. 2 2
      toolchain/check/testdata/return/fail_returned_var_type.carbon
  13. 2 2
      toolchain/check/testdata/return/fail_type_mismatch.carbon
  14. 2 2
      toolchain/check/testdata/struct/fail_field_type_mismatch.carbon
  15. 2 2
      toolchain/check/testdata/struct/fail_member_access_type.carbon
  16. 2 2
      toolchain/check/testdata/struct/member_access.carbon
  17. 1 1
      toolchain/lower/constant.cpp
  18. 2 2
      toolchain/lower/testdata/array/base.carbon
  19. 2 2
      toolchain/lower/testdata/basics/numeric_literals.carbon
  20. 1 1
      toolchain/sem_ir/expr_info.cpp
  21. 1 1
      toolchain/sem_ir/formatter.cpp
  22. 1 1
      toolchain/sem_ir/inst_kind.def
  23. 4 4
      toolchain/sem_ir/inst_namer.cpp
  24. 5 5
      toolchain/sem_ir/typed_insts.h

+ 6 - 6
toolchain/check/eval.cpp

@@ -336,7 +336,7 @@ static auto MakeFloatResult(Context& context, SemIR::TypeId type_id,
                             llvm::APFloat value) -> SemIR::ConstantId {
   auto result = context.floats().Add(std::move(value));
   return MakeConstantResult(
-      context, SemIR::FloatLiteral{.type_id = type_id, .float_id = result},
+      context, SemIR::FloatValue{.type_id = type_id, .float_id = result},
       Phase::Concrete);
 }
 
@@ -1405,7 +1405,7 @@ static auto PerformBuiltinUnaryFloatOp(Context& context,
                                        SemIR::BuiltinFunctionKind builtin_kind,
                                        SemIR::InstId arg_id)
     -> SemIR::ConstantId {
-  auto op = context.insts().GetAs<SemIR::FloatLiteral>(arg_id);
+  auto op = context.insts().GetAs<SemIR::FloatValue>(arg_id);
   auto op_val = context.floats().Get(op.float_id);
 
   switch (builtin_kind) {
@@ -1425,8 +1425,8 @@ static auto PerformBuiltinBinaryFloatOp(Context& context,
                                         SemIR::InstId lhs_id,
                                         SemIR::InstId rhs_id)
     -> SemIR::ConstantId {
-  auto lhs = context.insts().GetAs<SemIR::FloatLiteral>(lhs_id);
-  auto rhs = context.insts().GetAs<SemIR::FloatLiteral>(rhs_id);
+  auto lhs = context.insts().GetAs<SemIR::FloatValue>(lhs_id);
+  auto rhs = context.insts().GetAs<SemIR::FloatValue>(rhs_id);
   auto lhs_val = context.floats().Get(lhs.float_id);
   auto rhs_val = context.floats().Get(rhs.float_id);
 
@@ -1457,8 +1457,8 @@ static auto PerformBuiltinFloatComparison(
     Context& context, SemIR::BuiltinFunctionKind builtin_kind,
     SemIR::InstId lhs_id, SemIR::InstId rhs_id, SemIR::TypeId bool_type_id)
     -> SemIR::ConstantId {
-  auto lhs = context.insts().GetAs<SemIR::FloatLiteral>(lhs_id);
-  auto rhs = context.insts().GetAs<SemIR::FloatLiteral>(rhs_id);
+  auto lhs = context.insts().GetAs<SemIR::FloatValue>(lhs_id);
+  auto rhs = context.insts().GetAs<SemIR::FloatValue>(rhs_id);
   const auto& lhs_val = context.floats().Get(lhs.float_id);
   const auto& rhs_val = context.floats().Get(rhs.float_id);
 

+ 1 - 1
toolchain/check/handle_literal.cpp

@@ -80,7 +80,7 @@ auto HandleParseNode(Context& context, Parse::RealLiteralId node_id) -> bool {
                                real_value.exponent.getSExtValue());
 
   auto float_id = context.sem_ir().floats().Add(llvm::APFloat(double_val));
-  AddInstAndPush<SemIR::FloatLiteral>(
+  AddInstAndPush<SemIR::FloatValue>(
       context, node_id,
       {.type_id = GetSingletonType(context, SemIR::LegacyFloatType::TypeInstId),
        .float_id = float_id});

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

@@ -95,12 +95,12 @@ let e: f64 = 5.0e39999999999999999993;
 // CHECK:STDOUT:   %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
 // CHECK:STDOUT:   %int_9.988: Core.IntLiteral = int_value 9 [concrete]
 // CHECK:STDOUT:   %int_2147483647.d89: Core.IntLiteral = int_value 2147483647 [concrete]
-// CHECK:STDOUT:   %float.952: f64 = float_literal 0.90000000000000002 [concrete]
-// CHECK:STDOUT:   %float.298: f64 = float_literal 8 [concrete]
-// CHECK:STDOUT:   %float.dcb: f64 = float_literal 80 [concrete]
-// CHECK:STDOUT:   %float.1d0: f64 = float_literal 1.0E+7 [concrete]
-// CHECK:STDOUT:   %float.9f6: f64 = float_literal 1.0E+8 [concrete]
-// CHECK:STDOUT:   %float.401: f64 = float_literal 1.0E-8 [concrete]
+// CHECK:STDOUT:   %float.2c5: f64 = float_value 0.90000000000000002 [concrete]
+// CHECK:STDOUT:   %float.613: f64 = float_value 8 [concrete]
+// CHECK:STDOUT:   %float.707: f64 = float_value 80 [concrete]
+// CHECK:STDOUT:   %float.213: f64 = float_value 1.0E+7 [concrete]
+// CHECK:STDOUT:   %float.577: f64 = float_value 1.0E+8 [concrete]
+// CHECK:STDOUT:   %float.ef9: f64 = float_value 1.0E-8 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -116,12 +116,12 @@ let e: f64 = 5.0e39999999999999999993;
 // CHECK:STDOUT:   %int_2147483647.loc13: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89]
 // CHECK:STDOUT:   %int_2147483647.loc14: Core.IntLiteral = int_value 2147483647 [concrete = constants.%int_2147483647.d89]
 // CHECK:STDOUT:   <elided>
-// CHECK:STDOUT:   %float.loc19: f64 = float_literal 0.90000000000000002 [concrete = constants.%float.952]
-// CHECK:STDOUT:   %float.loc20: f64 = float_literal 8 [concrete = constants.%float.298]
-// CHECK:STDOUT:   %float.loc21: f64 = float_literal 80 [concrete = constants.%float.dcb]
-// CHECK:STDOUT:   %float.loc22: f64 = float_literal 1.0E+7 [concrete = constants.%float.1d0]
-// CHECK:STDOUT:   %float.loc23: f64 = float_literal 1.0E+8 [concrete = constants.%float.9f6]
-// CHECK:STDOUT:   %float.loc24: f64 = float_literal 1.0E-8 [concrete = constants.%float.401]
+// CHECK:STDOUT:   %float.loc19: f64 = float_value 0.90000000000000002 [concrete = constants.%float.2c5]
+// CHECK:STDOUT:   %float.loc20: f64 = float_value 8 [concrete = constants.%float.613]
+// CHECK:STDOUT:   %float.loc21: f64 = float_value 80 [concrete = constants.%float.707]
+// CHECK:STDOUT:   %float.loc22: f64 = float_value 1.0E+7 [concrete = constants.%float.213]
+// CHECK:STDOUT:   %float.loc23: f64 = float_value 1.0E+8 [concrete = constants.%float.577]
+// CHECK:STDOUT:   %float.loc24: f64 = float_value 1.0E-8 [concrete = constants.%float.ef9]
 // CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

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

@@ -41,7 +41,7 @@ fn F() {
 // CHECK:STDOUT:   %G: %G.type = struct_value () [concrete]
 // CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
 // CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
 // CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
 // CHECK:STDOUT: }
@@ -86,7 +86,7 @@ fn F() {
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete = constants.%float]
 // CHECK:STDOUT:   %.loc28: %i32 = converted %float, <error> [concrete = <error>]
 // CHECK:STDOUT:   %G.call: init %empty_tuple.type = call %G.ref(<error>)
 // CHECK:STDOUT:   return

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

@@ -35,7 +35,7 @@ fn Run() {
 // CHECK:STDOUT:   %Foo.type: type = fn_type @Foo [concrete]
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %Foo: %Foo.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete]
 // CHECK:STDOUT:   %Run.type: type = fn_type @Run [concrete]
 // CHECK:STDOUT:   %Run: %Run.type = struct_value () [concrete]
 // CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
@@ -90,7 +90,7 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Foo() -> f64 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete = constants.%float]
 // CHECK:STDOUT:   return %float
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 2
toolchain/check/testdata/index/fail_array_non_int_indexing.carbon

@@ -53,7 +53,7 @@ var b: i32 = a[2.6];
 // CHECK:STDOUT:   %bound_method: <bound method> = bound_method %int_12.6a3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
 // CHECK:STDOUT:   %int_12.1e1: %i32 = int_value 12 [concrete]
 // CHECK:STDOUT:   %array: %array_type = tuple_value (%int_12.1e1) [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 2.6000000000000001 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 2.6000000000000001 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -117,7 +117,7 @@ var b: i32 = a[2.6];
 // CHECK:STDOUT:   %.loc15_1: init %array_type = converted %.loc15_28.1, %.loc15_28.5 [concrete = constants.%array]
 // CHECK:STDOUT:   assign file.%a.var, %.loc15_1
 // CHECK:STDOUT:   %a.ref: ref %array_type = name_ref a, file.%a [concrete = file.%a.var]
-// CHECK:STDOUT:   %float: f64 = float_literal 2.6000000000000001 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 2.6000000000000001 [concrete = constants.%float]
 // CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
 // CHECK:STDOUT:   %.loc23_16: %i32 = converted %float, <error> [concrete = <error>]

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon

@@ -1096,7 +1096,7 @@ fn F() {
 // CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
 // CHECK:STDOUT:   %foo.type: type = fn_type @foo [concrete]
 // CHECK:STDOUT:   %foo: %foo.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 0.80000000000000004 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 0.80000000000000004 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -1115,7 +1115,7 @@ fn F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
 // CHECK:STDOUT:   %foo.ref: %foo.type = name_ref foo, imports.%foo.decl [concrete = constants.%foo]
-// CHECK:STDOUT:   %float: f64 = float_literal 0.80000000000000004 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 0.80000000000000004 [concrete = constants.%float]
 // CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
 // CHECK:STDOUT:   %Float.call: init type = call constants.%Float(%int_64) [concrete = f64]
 // CHECK:STDOUT:   %.loc8_18.1: type = value_of_initializer %Float.call [concrete = f64]

+ 4 - 4
toolchain/check/testdata/interop/cpp/function/param_unsupported.carbon

@@ -67,7 +67,7 @@ fn F() {
 // CHECK:STDOUT: --- fail_todo_import_unsupported_primitive_type.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %float: f64 = float_literal 1.1000000000000001 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1.1000000000000001 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -81,7 +81,7 @@ fn F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
 // CHECK:STDOUT:   %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
-// CHECK:STDOUT:   %float: f64 = float_literal 1.1000000000000001 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1.1000000000000001 [concrete = constants.%float]
 // CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -89,7 +89,7 @@ fn F() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 2 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 2 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
@@ -104,7 +104,7 @@ fn F() {
 // CHECK:STDOUT:   %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
 // CHECK:STDOUT:   %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
-// CHECK:STDOUT:   %float: f64 = float_literal 2 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 2 [concrete = constants.%float]
 // CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 2 - 2
toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon

@@ -53,7 +53,7 @@ fn Main() {
 // CHECK:STDOUT:   %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.956, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
 // CHECK:STDOUT:   %bound_method: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
 // CHECK:STDOUT:   %int_3.822: %i32 = int_value 3 [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 5.6000000000000005 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 5.6000000000000005 [concrete]
 // CHECK:STDOUT:   %T.as.Destroy.impl.Op.type.a17: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%i32) [concrete]
 // CHECK:STDOUT:   %T.as.Destroy.impl.Op.e6a: %T.as.Destroy.impl.Op.type.a17 = struct_value () [concrete]
 // CHECK:STDOUT:   %ptr.235: type = ptr_type %i32 [concrete]
@@ -105,7 +105,7 @@ fn Main() {
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %a: ref %i32 = bind_name a, %a.var
 // CHECK:STDOUT:   %a.ref: ref %i32 = name_ref a, %a
-// CHECK:STDOUT:   %float: f64 = float_literal 5.6000000000000005 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 5.6000000000000005 [concrete = constants.%float]
 // CHECK:STDOUT:   %.loc24: %i32 = converted %float, <error> [concrete = <error>]
 // CHECK:STDOUT:   assign %a.ref, <error>
 // CHECK:STDOUT:   %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.e6a

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

@@ -33,7 +33,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT:   %Main.type: type = fn_type @Main [concrete]
 // CHECK:STDOUT:   %Main: %Main.type = struct_value () [concrete]
 // CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 3.4000000000000004 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 3.4000000000000004 [concrete]
 // CHECK:STDOUT:   %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
 // CHECK:STDOUT:   %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
 // CHECK:STDOUT:   %int_12: Core.IntLiteral = int_value 12 [concrete]
@@ -70,7 +70,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT: fn @Main() -> %i32 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc22: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:   %float: f64 = float_literal 3.4000000000000004 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 3.4000000000000004 [concrete = constants.%float]
 // CHECK:STDOUT:   %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
 // CHECK:STDOUT:   %impl.elem1: <error> = impl_witness_access <error>, element1 [concrete = <error>]
 // CHECK:STDOUT:   return <error>

+ 2 - 2
toolchain/check/testdata/pointer/fail_address_of_value.carbon

@@ -125,7 +125,7 @@ fn AddressOfParam(param: i32) {
 // CHECK:STDOUT:   %ptr.1d1: type = ptr_type Core.IntLiteral [concrete]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
 // CHECK:STDOUT:   %ptr.bb2: type = ptr_type bool [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete]
 // CHECK:STDOUT:   %ptr.ef1: type = ptr_type f64 [concrete]
 // CHECK:STDOUT:   %ptr.a45: type = ptr_type String [concrete]
 // CHECK:STDOUT:   %str: String = string_literal "Hello" [concrete]
@@ -235,7 +235,7 @@ fn AddressOfParam(param: i32) {
 // CHECK:STDOUT:   %addr.loc24: %ptr.1d1 = addr_of <error> [concrete = <error>]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete = constants.%true]
 // CHECK:STDOUT:   %addr.loc29: %ptr.bb2 = addr_of <error> [concrete = <error>]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete = constants.%float]
 // CHECK:STDOUT:   %addr.loc34: %ptr.ef1 = addr_of <error> [concrete = <error>]
 // CHECK:STDOUT:   %str: String = string_literal "Hello" [concrete = constants.%str]
 // CHECK:STDOUT:   %addr.loc39: %ptr.a45 = addr_of <error> [concrete = <error>]

+ 2 - 2
toolchain/check/testdata/return/fail_returned_var_type.carbon

@@ -39,7 +39,7 @@ fn Mismatch() -> i32 {
 // CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
 // CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
 // CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 0 [concrete]
 // CHECK:STDOUT:   %Destroy.type: type = facet_type <@Destroy> [concrete]
 // CHECK:STDOUT:   %T.as.Destroy.impl.Op.type.3ef: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(f64) [concrete]
 // CHECK:STDOUT:   %T.as.Destroy.impl.Op.868: %T.as.Destroy.impl.Op.type.3ef = struct_value () [concrete]
@@ -84,7 +84,7 @@ fn Mismatch() -> i32 {
 // CHECK:STDOUT:     %v.var_patt: %pattern_type.3de = var_pattern %v.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %v.var: ref f64 = var %v.var_patt
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 0 [concrete = constants.%float]
 // CHECK:STDOUT:   assign %v.var, %float
 // CHECK:STDOUT:   %.loc23_19.1: type = splice_block %.loc23_19.3 [concrete = f64] {
 // CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]

+ 2 - 2
toolchain/check/testdata/return/fail_type_mismatch.carbon

@@ -33,7 +33,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
 // CHECK:STDOUT:   %Main.type: type = fn_type @Main [concrete]
 // CHECK:STDOUT:   %Main: %Main.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
 // CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
 // CHECK:STDOUT: }
@@ -68,7 +68,7 @@ fn Main() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() -> %i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete = constants.%float]
 // CHECK:STDOUT:   %.loc23: %i32 = converted %float, <error> [concrete = <error>]
 // CHECK:STDOUT:   return <error>
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/check/testdata/struct/fail_field_type_mismatch.carbon

@@ -27,7 +27,7 @@ var x: {.a: i32} = {.b = 1.0};
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
 // CHECK:STDOUT:   %struct_type.a: type = struct_type {.a: %i32} [concrete]
 // CHECK:STDOUT:   %pattern_type.268: type = pattern_type %struct_type.a [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete]
 // CHECK:STDOUT:   %struct_type.b: type = struct_type {.b: f64} [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
@@ -61,7 +61,7 @@ var x: {.a: i32} = {.b = 1.0};
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 1 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 1 [concrete = constants.%float]
 // CHECK:STDOUT:   %.loc19: %struct_type.b = struct_literal (%float)
 // CHECK:STDOUT:   assign file.%x.var, <error>
 // CHECK:STDOUT:   return

+ 2 - 2
toolchain/check/testdata/struct/fail_member_access_type.carbon

@@ -27,7 +27,7 @@ var y: i32 = x.b;
 // CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
 // CHECK:STDOUT:   %struct_type.a: type = struct_type {.a: f64} [concrete]
 // CHECK:STDOUT:   %pattern_type.d08: type = pattern_type %struct_type.a [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 4 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 4 [concrete]
 // CHECK:STDOUT:   %struct: %struct_type.a = struct_value (%float) [concrete]
 // CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
 // CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
@@ -81,7 +81,7 @@ var y: i32 = x.b;
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 4 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 4 [concrete = constants.%float]
 // CHECK:STDOUT:   %.loc15_29.1: %struct_type.a = struct_literal (%float)
 // CHECK:STDOUT:   %.loc15_29.2: init %struct_type.a = struct_init (%float) to file.%x.var [concrete = constants.%struct]
 // CHECK:STDOUT:   %.loc15_1: init %struct_type.a = converted %.loc15_29.1, %.loc15_29.2 [concrete = constants.%struct]

+ 2 - 2
toolchain/check/testdata/struct/member_access.carbon

@@ -28,7 +28,7 @@ var z: i32 = y;
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
 // CHECK:STDOUT:   %struct_type.a.b.ddf: type = struct_type {.a: f64, .b: %i32} [concrete]
 // CHECK:STDOUT:   %pattern_type.7fd: type = pattern_type %struct_type.a.b.ddf [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete]
+// CHECK:STDOUT:   %float: f64 = float_value 0 [concrete]
 // CHECK:STDOUT:   %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %struct_type.a.b.fbb: type = struct_type {.a: f64, .b: Core.IntLiteral} [concrete]
 // CHECK:STDOUT:   %.984: ref f64 = struct_access file.%x.var, element0 [concrete]
@@ -115,7 +115,7 @@ var z: i32 = y;
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete = constants.%float]
+// CHECK:STDOUT:   %float: f64 = float_value 0 [concrete = constants.%float]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
 // CHECK:STDOUT:   %.loc15_46.1: %struct_type.a.b.fbb = struct_literal (%float, %int_1)
 // CHECK:STDOUT:   %.loc15_46.2: ref f64 = struct_access file.%x.var, element0 [concrete = constants.%.984]

+ 1 - 1
toolchain/lower/constant.cpp

@@ -222,7 +222,7 @@ static auto EmitAsConstant(ConstantContext& context, SemIR::FieldDecl inst)
   return context.GetUnusedConstant(inst.type_id);
 }
 
-static auto EmitAsConstant(ConstantContext& context, SemIR::FloatLiteral inst)
+static auto EmitAsConstant(ConstantContext& context, SemIR::FloatValue inst)
     -> llvm::Constant* {
   const llvm::APFloat& value = context.sem_ir().floats().Get(inst.float_id);
   return llvm::ConstantFP::get(context.GetType(inst.type_id), value);

+ 2 - 2
toolchain/lower/testdata/array/base.carbon

@@ -22,7 +22,7 @@ fn Run() {
 // CHECK:STDOUT: source_filename = "base.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: @array.237.loc14_3 = internal constant [1 x i32] [i32 1]
-// CHECK:STDOUT: @array.6a2.loc15_3 = internal constant [2 x double] [double 0x4026333333333334, double 2.200000e+00]
+// CHECK:STDOUT: @array.13b.loc15_3 = internal constant [2 x double] [double 0x4026333333333334, double 2.200000e+00]
 // CHECK:STDOUT: @array.1cb.loc16_3 = internal constant [5 x {}] zeroinitializer
 // CHECK:STDOUT: @tuple.loc17_3 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 }
 // CHECK:STDOUT:
@@ -39,7 +39,7 @@ fn Run() {
 // CHECK:STDOUT:   call void @llvm.lifetime.start.p0(i64 16, ptr %b.var), !dbg !8
 // CHECK:STDOUT:   %.loc15_37.2.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 0, !dbg !13
 // CHECK:STDOUT:   %.loc15_37.4.array.index = getelementptr inbounds [2 x double], ptr %b.var, i32 0, i64 1, !dbg !13
-// CHECK:STDOUT:   call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.6a2.loc15_3, i64 16, i1 false), !dbg !8
+// CHECK:STDOUT:   call void @llvm.memcpy.p0.p0.i64(ptr align 8 %b.var, ptr align 8 @array.13b.loc15_3, i64 16, i1 false), !dbg !8
 // CHECK:STDOUT:   call void @llvm.lifetime.start.p0(i64 0, ptr %c.var), !dbg !9
 // CHECK:STDOUT:   %.loc16_45.2.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 0, !dbg !14
 // CHECK:STDOUT:   %.loc16_45.4.array.index = getelementptr inbounds [5 x {}], ptr %c.var, i32 0, i64 1, !dbg !14

+ 2 - 2
toolchain/lower/testdata/basics/numeric_literals.carbon

@@ -33,7 +33,7 @@ fn F() {
 // CHECK:STDOUT: source_filename = "numeric_literals.carbon"
 // CHECK:STDOUT:
 // CHECK:STDOUT: @array.712.loc16_3 = internal constant [4 x i32] [i32 8, i32 9, i32 8, i32 8]
-// CHECK:STDOUT: @array.a2f.loc22_3 = internal constant [6 x double] [double 9.000000e-01, double 8.000000e+00, double 8.000000e+01, double 1.000000e+07, double 1.000000e+08, double 1.000000e-08]
+// CHECK:STDOUT: @array.f02.loc22_3 = internal constant [6 x double] [double 9.000000e-01, double 8.000000e+00, double 8.000000e+01, double 1.000000e+07, double 1.000000e+08, double 1.000000e-08]
 // CHECK:STDOUT:
 // CHECK:STDOUT: define void @_CF.Main() !dbg !4 {
 // CHECK:STDOUT: entry:
@@ -52,7 +52,7 @@ fn F() {
 // CHECK:STDOUT:   %.loc29_3.8.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 3, !dbg !10
 // CHECK:STDOUT:   %.loc29_3.10.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 4, !dbg !10
 // CHECK:STDOUT:   %.loc29_3.12.array.index = getelementptr inbounds [6 x double], ptr %floats.var, i32 0, i64 5, !dbg !10
-// CHECK:STDOUT:   call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.a2f.loc22_3, i64 48, i1 false), !dbg !8
+// CHECK:STDOUT:   call void @llvm.memcpy.p0.p0.i64(ptr align 8 %floats.var, ptr align 8 @array.f02.loc22_3, i64 48, i1 false), !dbg !8
 // CHECK:STDOUT:   ret void, !dbg !11
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 1 - 1
toolchain/sem_ir/expr_info.cpp

@@ -113,8 +113,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory {
       case FacetAccessType::Kind:
       case FacetType::Kind:
       case FacetValue::Kind:
-      case FloatLiteral::Kind:
       case FloatType::Kind:
+      case FloatValue::Kind:
       case FunctionType::Kind:
       case FunctionTypeWithSelfType::Kind:
       case GenericClassType::Kind:

+ 1 - 1
toolchain/sem_ir/formatter.cpp

@@ -1023,7 +1023,7 @@ auto Formatter::FormatInstRhs(Inst inst) -> void {
       return;
     }
 
-    case CARBON_KIND(FloatLiteral value): {
+    case CARBON_KIND(FloatValue value): {
       llvm::SmallVector<char, 16> buffer;
       sem_ir_->floats().Get(value.float_id).toString(buffer);
       out_ << " " << buffer;

+ 1 - 1
toolchain/sem_ir/inst_kind.def

@@ -63,8 +63,8 @@ CARBON_SEM_IR_INST_KIND(FacetAccessType)
 CARBON_SEM_IR_INST_KIND(FacetType)
 CARBON_SEM_IR_INST_KIND(FacetValue)
 CARBON_SEM_IR_INST_KIND(FieldDecl)
-CARBON_SEM_IR_INST_KIND(FloatLiteral)
 CARBON_SEM_IR_INST_KIND(FloatType)
+CARBON_SEM_IR_INST_KIND(FloatValue)
 CARBON_SEM_IR_INST_KIND(FunctionDecl)
 CARBON_SEM_IR_INST_KIND(FunctionType)
 CARBON_SEM_IR_INST_KIND(FunctionTypeWithSelfType)

+ 4 - 4
toolchain/sem_ir/inst_namer.cpp

@@ -845,14 +845,14 @@ auto InstNamer::NamingContext::NameInst() -> void {
       AddInstName("facet_value");
       return;
     }
-    case FloatLiteral::Kind: {
-      AddInstName("float");
-      return;
-    }
     case CARBON_KIND(FloatType inst): {
       AddIntOrFloatTypeName('f', inst.bit_width_id);
       return;
     }
+    case FloatValue::Kind: {
+      AddInstName("float");
+      return;
+    }
     case CARBON_KIND(FunctionDecl inst): {
       AddEntityNameAndMaybePush(inst.function_id, ".decl");
       auto function_scope_id = inst_namer_->GetScopeFor(inst.function_id);

+ 5 - 5
toolchain/sem_ir/typed_insts.h

@@ -662,11 +662,11 @@ struct FieldDecl {
   ElementIndex index;
 };
 
-// A literal floating point value.
-struct FloatLiteral {
+// A floating point value.
+struct FloatValue {
   static constexpr auto Kind =
-      InstKind::FloatLiteral.Define<Parse::RealLiteralId>(
-          {.ir_name = "float_literal",
+      InstKind::FloatValue.Define<Parse::RealLiteralId>(
+          {.ir_name = "float_value",
            .constant_kind = InstConstantKind::Always});
 
   TypeId type_id;
@@ -1026,7 +1026,7 @@ struct IntType {
   InstId bit_width_id;
 };
 
-// A literal integer value.
+// An integer value.
 struct IntValue {
   // TODO: Make Parse::NodeId more specific.
   static constexpr auto Kind = InstKind::IntValue.Define<Parse::NodeId>(