aboutsummaryrefslogtreecommitdiffstats
path: root/scheduling/RTLtoBTL.v
diff options
context:
space:
mode:
authorLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2021-09-01 16:08:57 +0200
committerLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2021-09-01 16:08:57 +0200
commit269208723faff37e6f6539b71101515b17a8a36f (patch)
tree2a52dd6fc5ae0b65b2a40a08c8e20c2eb8357ff3 /scheduling/RTLtoBTL.v
parent1fbe45e2d1f02ef6e8fb6fe7545728a744e047b8 (diff)
parent54a22d92bc18fa3ece958a097844caa5e7b2e0c5 (diff)
downloadcompcert-kvx-269208723faff37e6f6539b71101515b17a8a36f.tar.gz
compcert-kvx-269208723faff37e6f6539b71101515b17a8a36f.zip
[MERGE] BTL into kvx-work (replacing RTLpath)
Diffstat (limited to 'scheduling/RTLtoBTL.v')
-rw-r--r--scheduling/RTLtoBTL.v27
1 files changed, 27 insertions, 0 deletions
diff --git a/scheduling/RTLtoBTL.v b/scheduling/RTLtoBTL.v
new file mode 100644
index 00000000..309c616e
--- /dev/null
+++ b/scheduling/RTLtoBTL.v
@@ -0,0 +1,27 @@
+Require Import Coqlib Maps.
+Require Import AST Integers Values Events Memory Globalenvs Smallstep.
+Require Import RTL Op Registers OptionMonad BTL.
+Require Export BTLmatchRTL BTL_Livecheck.
+
+Require Import Errors Linking.
+
+(** External oracle *)
+Axiom rtl2btl: RTL.function -> BTL.code * node * (PTree.t node).
+
+Extract Constant rtl2btl => "RTLtoBTLaux.rtl2btl".
+
+Local Open Scope error_monad_scope.
+
+Definition transf_function (f: RTL.function) : res BTL.function :=
+ let (tcte, dupmap) := rtl2btl f in
+ let (tc, te) := tcte in
+ let f' := BTL.mkfunction (RTL.fn_sig f) (RTL.fn_params f) (RTL.fn_stacksize f) tc te in
+ do u <- verify_function dupmap f' f;
+ do u <- liveness_checker f';
+ OK f'.
+
+Definition transf_fundef (f: RTL.fundef) : res fundef :=
+ transf_partial_fundef transf_function f.
+
+Definition transf_program (p: RTL.program) : res program :=
+ transform_partial_program transf_fundef p.