<commit_before>open Ir

let rec string_of_val_type = function
  | Int(w) -> "(" ^ "i" ^ string_of_int w ^ ")"
  | UInt(w) -> "(" ^ "u" ^ string_of_int w ^ ")"
  | Float(w) -> "(" ^ "f" ^ string_of_int w ^ ")"

and string_of_expr = function
  | IntImm(i) -> string_of_int i
  | UIntImm(i) -> "u" ^ string_of_int i
  | FloatImm(f) -> string_of_float f

  | Add(t, (l,r)) -> "(" ^ string_of_val_type t ^ string_of_expr l ^ "+" ^ string_of_expr r ^ ")"
  | Sub(t, (l,r)) -> "(" ^ string_of_val_type t ^ string_of_expr l ^ "-" ^ string_of_expr r ^ ")"
  | Mul(t, (l,r)) -> "(" ^ string_of_val_type t ^ string_of_expr l ^ "*" ^ string_of_expr r ^ ")"
  | Div(t, (l,r)) -> "(" ^ string_of_val_type t ^ string_of_expr l ^ "/" ^ string_of_expr r ^ ")"

  | Var(s) -> s

  | Load(t, mr) -> "load" ^ "(" ^ string_of_val_type t ^ "," ^ string_of_memref mr ^ ")"
  | _ -> "<<UNHANDLED>>"

and string_of_stmt = function<commit_msg>Mild pretty-printer cleanup<commit_after>open Ir

let rec string_of_val_type = function
  | Int(w) -> "[" ^ "i" ^ string_of_int w ^ "]"
  | UInt(w) -> "[" ^ "u" ^ string_of_int w ^ "]"
  | Float(w) -> "[" ^ "f" ^ string_of_int w ^ "]"

and string_of_expr = function
  | IntImm(i) -> string_of_int i
  | UIntImm(i) -> string_of_int i ^ "u"
  | FloatImm(f) -> string_of_float f

  | Add(t, (l,r)) ->
      "(" ^ string_of_expr l ^ string_of_val_type t ^ "+" ^ string_of_expr r ^ ")"
  | Sub(t, (l,r)) ->
      "(" ^ string_of_expr l ^ string_of_val_type t ^ "-" ^ string_of_expr r ^ ")"
  | Mul(t, (l,r)) ->
      "(" ^ string_of_expr l ^ string_of_val_type t ^ "*" ^ string_of_expr r ^ ")"
  | Div(t, (l,r)) ->
      "(" ^ string_of_expr l ^ string_of_val_type t ^ "/" ^ string_of_expr r ^ ")"

  | Var(s) -> s

  | Load(t, mr) -> "load" ^ "(" ^ string_of_val_type t ^ "," ^ string_of_memref mr ^ ")"

  | _ -> "<<UNHANDLED>>"

and string_of_stmt = function
{'fraction_non_alphanumeric': 0.21409503470368393, 'fraction_numerical': 0.0, 'mean_word_length': 3.2112359550561798, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '64802', 'n_tokens_mistral': 837, 'n_tokens_neox': 820, 'n_words': 153}