let compute_dom kf =
  let start = Kernel_function.find_first_stmt kf in
  try
    let _ = Dom.find start.sid in
    DomKernel.feedback ~level:2 "computed for function %a"
      Kernel_function.pretty kf;
  with Not_found ->
    DomKernel.feedback ~level:2 "computing for function %a"
      Kernel_function.pretty kf;
    let f = kf.fundec in
    let stmts = match f with
    | Definition (f,_) -> f.sallstmts
    | Declaration _ ->
      DomKernel.fatal "cannot compute for a leaf function %a"
        Kernel_function.pretty kf
    in
    List.iter (fun s -> Dom.add s.sid DomSet.Top) stmts;
    Dom.replace start.sid (DomSet.Value (Stmt.Hptset.singleton start));
    DomCompute.compute [start];
    DomKernel.feedback ~level:2 "done for function %a"
      Kernel_function.pretty kf