Skip to content

Cleanup machtype_component size #3441

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -2316,7 +2316,7 @@ let emit_probe_notes0 () =
Misc.fatal_errorf "Cannot create probe: illegal argument: %a"
Printreg.reg arg
in
Printf.sprintf "%d@%s" (Reg.size_of_contents_in_bytes arg) arg_name
Printf.sprintf "%d@%s" (Select_utils.size_component arg.Reg.typ) arg_name
in
let describe_one_probe p =
let probe_name, enabled_at_init =
Expand Down
12 changes: 0 additions & 12 deletions backend/reg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,6 @@ let is_reg t =
| Reg _ -> true
| _ -> false

let size_of_contents_in_bytes t =
match t.typ with
| Vec128 -> Arch.size_vec128
| Float -> Arch.size_float
| Float32 ->
assert (Arch.size_float = 8);
Arch.size_float / 2
| Addr ->
assert (Arch.size_addr = Arch.size_int);
Arch.size_addr
| Int | Val -> Arch.size_int

let reset() =
(* When reset() is called for the first time, the current stamp reflects
all hard pseudo-registers that have been allocated by Proc, so
Expand Down
2 changes: 0 additions & 2 deletions backend/reg.mli
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ val name : t -> string
val is_reg : t -> bool
val is_stack : t -> bool

val size_of_contents_in_bytes : t -> int

module Set: Set.S with type elt = t
module Map: Map.S with type key = t
module Tbl: Hashtbl.S with type key = t
Expand Down
2 changes: 2 additions & 0 deletions backend/select_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ let oper_result_type = function
(* Infer the size in bytes of the result of an expression whose evaluation may
be deferred (cf. [emit_parts]). *)

(* [size_component] is placed here and not in [Cmm] to avoid cyclic
dependencies, because it uses [Arch]. *)
let size_component : machtype_component -> int = function
| Val | Addr -> Arch.size_addr
| Int -> Arch.size_int
Expand Down
Loading