2011-04-14 11:53:39 +02:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Heptagon *)
|
|
|
|
(* *)
|
|
|
|
(* Author : Marc Pouzet *)
|
|
|
|
(* Organization : Demons, LRI, University of Paris-Sud, Orsay *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
open Misc
|
|
|
|
open Location
|
|
|
|
open Compiler_utils
|
|
|
|
open Compiler_options
|
|
|
|
|
|
|
|
let pp p = if !verbose then Obc_printer.print stdout p
|
|
|
|
|
|
|
|
let compile_program p =
|
2011-04-20 18:20:53 +02:00
|
|
|
|
|
|
|
(* Memory allocation application *)
|
2011-09-09 16:05:44 +02:00
|
|
|
let p = pass "Application of Memory Allocation"
|
|
|
|
(!do_mem_alloc or !do_linear_typing) Memalloc_apply.program p pp in
|
2011-04-20 18:20:53 +02:00
|
|
|
|
2011-11-17 15:28:46 +01:00
|
|
|
(*Scalarize for wanting backends*)
|
|
|
|
let p = pass "Scalarize" (!do_scalarize) Scalarize.program p pp in
|
|
|
|
|
|
|
|
(*Simplify*)
|
|
|
|
let p = pass "Simplify" (!do_simplify) Simplify.program p pp in
|
|
|
|
|
2011-04-21 11:24:04 +02:00
|
|
|
(*Dead code removal*)
|
2011-09-09 16:05:44 +02:00
|
|
|
let p = pass "Dead code removal"
|
|
|
|
(!do_mem_alloc or !do_linear_typing) Deadcode.program p pp in
|
2011-04-21 11:24:04 +02:00
|
|
|
|
2011-11-03 00:43:36 +01:00
|
|
|
(*Control optimization*)
|
|
|
|
let p = pass "Control optimization" true Control.program p pp in
|
|
|
|
|
2012-02-08 16:16:41 +01:00
|
|
|
(*Loop unrolling*)
|
|
|
|
let p = pass "Loop unrolling" !Compiler_options.unroll_loops Unroll.program p pp in
|
|
|
|
|
2011-04-19 18:45:56 +02:00
|
|
|
p
|