From d84e0dac79287b481a833cce3353c0d59fa7b9a1 Mon Sep 17 00:00:00 2001 From: Teddy Date: Sun, 18 May 2014 10:33:26 +0800 Subject: report: workflow --- cibic.tex | 23 +++++++++++++++++++++++ ssa.c | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cibic.tex b/cibic.tex index d8b1aa3..fdcd47f 100644 --- a/cibic.tex +++ b/cibic.tex @@ -584,6 +584,29 @@ a_0[8] = t12 to guide the final translation. Of course, the code above does produce correct result compiled by CIBIC. \end{enumerate} + +\begin{figure}[H] + \centering + \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{} + \begin{minted}{c} +calc_dominance_frontier(); +/* build SSA */ +insert_phi(vars); +renaming_vars(oprs); +/* optimization on SSA */ +const_propagation(); +subexp_elimination(); +const_propagation(); +strength_reduction(); +deadcode_elimination(); +/* out of SSA */ +mark_insts(); +build_intervals(); +register_alloc(); + \end{minted} + \caption{Workflow of CIBIC IR} +\end{figure} + \subsection{Single Static Assignment Form} CIBIC makes good use of SSA (Single Static Assignment) form. SSA form is a property of an IR, which says that each variable is assigned \textbf{exactly diff --git a/ssa.c b/ssa.c index af1311f..ba76a2b 100644 --- a/ssa.c +++ b/ssa.c @@ -1414,7 +1414,7 @@ int intersect(int b1, int b2) { return b1; } -void calc_dominant_frontier(void) { +void calc_dominance_frontier(void) { int i; int ch = 1; ocnt = 0; @@ -2706,7 +2706,7 @@ void ssa_func(CType_t func) { } cpset_destroy(avs); cpset_destroy(vs); - calc_dominant_frontier(); + calc_dominance_frontier(); /* build SSA */ insert_phi(vars); renaming_vars(oprs); -- cgit v1.2.3-70-g09d2