Module Sarek_execute.Ir_rename

Renaming of a kernel's names, shared by the fusion rewrites (specs/launch-window.md, specs/epilogue-fusion.md).

Every variable, array and pattern name goes through name, every var id through id, and every argument-less Sarek_stdlib.Gpu intrinsic through position (which may replace it). Helper functions are called by their own names, which are left alone. Record fields and constructors are not names of the kernel and are left alone too.

type ctx = {
  1. name : string -> string;
  2. id : int -> int;
  3. position : string -> Sarek_ir_types.expr option;
}

Variable ids

val max_id_expr : int -> Sarek_ir_types.expr -> int
val max_id_lvalue : int -> Sarek_ir_types.lvalue -> int
val max_id_stmt : int -> Sarek_ir_types.stmt -> int
val max_var_id : Sarek_ir_types.kernel -> int