aboutsummaryrefslogtreecommitdiffstats
path: root/scheduling/BTLtoRTL.v
blob: fc58533d4ba507b172db718895e9cee6d1a82c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Require Import Coqlib Maps.
Require Import AST Integers Values Events Memory Globalenvs Smallstep.
Require Import RTL Op Registers OptionMonad BTL.
Require Export BTLmatchRTL.

Require Import Errors Linking.

(** External oracle *)
Axiom btl2rtl: BTL.function -> RTL.code * node * (PTree.t node).

Extract Constant btl2rtl => "BTLtoRTLaux.btl2rtl".

Local Open Scope error_monad_scope.

Definition transf_function (f: BTL.function) : res RTL.function :=
  let (tcte, dupmap) := btl2rtl f in
  let (tc, te) := tcte in
  let f' := RTL.mkfunction (fn_sig f) (fn_params f) (fn_stacksize f) tc te in
  do u <- verify_function dupmap f f';
  OK f'.

Definition transf_fundef (f: fundef) : res RTL.fundef :=
  transf_partial_fundef transf_function f.

Definition transf_program (p: program) : res RTL.program :=
  transform_partial_program transf_fundef p.