Update first few slides.
[matthijs/projects/internship.git] / Presentations / InternalProgress.tex
1 \documentclass[hyperref={pdfpagelabels=false}]{beamer}
2
3 %\setbeameroption{show notes}
4
5 \mode<presentation>
6 {
7   %\useinnertheme{echt}
8   %\useinnertheme{proef}
9   \usetheme{recore}
10   \setbeamercovered{transparent}
11 %\setbeamertemplate{footline}[frame number]
12 }
13
14 \usepackage[english]{babel}
15 \usepackage[latin1]{inputenc}
16 \usepackage{times}
17 \usepackage[T1]{fontenc}
18 \usepackage{acronym}
19 \usepackage{tikz}
20 \usepackage{multimedia}
21 \usepackage{subfigure}
22 \usepackage{booktabs}
23 % Can use a tiny fontsize
24 \usepackage{fancyvrb}
25
26 %\usepackage{pgfpages}
27 %\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm]
28
29 %For handouts, use the following two lines:
30 %\usepackage{pgfpages}
31 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
32
33
34 \title
35 {MontiumC Transforming}
36
37 \author {Matthijs Kooijman}
38
39 \institute[Recore Systems and University of Twente]
40 {
41   \inst{}%
42   Recore Systems
43   \and
44   \inst{}%
45   Faculty of Electrical Engineering, Mathematics and Computer Science\\
46   University of Twente
47   }
48   
49 \begin{document}
50
51 \begin{frame}
52         \titlepage
53 \end{frame}
54
55 \begin{frame}{Contents}
56   \tableofcontents
57 \end{frame}
58
59 \section{Introduction}
60   \begin{frame}{Low Level Virtual Machine (LLVM)}
61     \begin{itemize}
62       \item Compiler framework.
63       \item Provides:
64       \begin{itemize}
65         \alert<2>{\item C Frontend}
66         \alert<2>{\item Intermediate representation (LLVM IR)}
67         \alert<2>{\item Transformation passes}
68         \item Native codegenerators
69         \item JIT compilation
70       \end{itemize}
71       \item Very modular
72     \end{itemize}
73   \end{frame}
74
75   \begin{frame}{Montium Workflow}
76     \pgfdeclareimage[width=\textwidth]{Workflow}{images/Workflow}
77     \pgfuseimage{Workflow}
78   \end{frame}
79
80 \section{Tasks}
81
82   \subsection{Original tasks}
83     \begin{frame}{Original tasks}
84       \begin{itemize}
85         \item Select LLVM transformations
86         \item Improve and add transformations
87         \item Provide debugging information
88       \end{itemize}
89     \end{frame}
90
91   \subsection{Extra tasks}
92     \begin{frame}{Extra tasks}
93       \begin{itemize}
94         \item What is MontiumC?
95         \item What is Montium IR?
96         \item Reconfigurable binaries
97       \end{itemize}
98     \end{frame}
99
100     \begin{frame}{What is MontiumC?}
101       \note{Two angles: What do we want, and what do we support.}
102       \begin{itemize}
103       \item Status: Specification is ongoing
104       \item Challenges:
105         \begin{itemize}
106           \item Clang is nontransparent
107           \note[item]{Clang --- A lot of special cases}
108           \item C is complex
109           \note[item]{Complex C --- A lot of corner cases}
110           \item C is limited
111           \note[item]{Limited C --- Need to use annotations, limited amount of types}
112           \item Assembly vs. High level
113           \note[item]{Tradeoffs -- Code size vs compiler complexity, clarity
114           vs control, clarity vs determinism}
115         \end{itemize}
116       \end{itemize}
117     \end{frame}
118
119     \begin{frame}[containsverbatim]
120       \begin{columns}
121         \begin{column}{0.5\textwidth}
122           Low level
123           \begin{Verbatim}[fontsize=\tiny]
124 mem input;
125 mem output;
126 word factor;
127
128 void run(void) {
129   factor = from_int(2);
130   input  = alloc_mem(P0M0);
131   output = alloc_mem(P0M1);
132   set_base(input, 0);
133   set_offset(input, 0);
134   set_base(output, -1);
135   set_offset(output, -1);
136
137   next_cycle();
138   word in = read_mem(input);
139   word out = p0o0(imul(ra1(in), rc1(factor)))
140   add_offset(input, 1);
141   add_offset(output, 1);
142   init_loop(LC1, 8);
143   do {
144     write_mem(output, out);
145     in = read_mem(input);
146     out = p0m0(imul(ra1(in), rc1(factor)))
147     add_offset(input, 1);
148     add_offset(output, 1);
149   } while(loop_next(LC1));
150
151   write_mem(output, out);
152 \end{Verbatim}
153         \end{column}
154         \begin{column}{0.5\textwidth}
155           High level
156           \begin{Verbatim}[fontsize=\tiny]
157 P0M0 int input[10];
158 P0M1 int output[10];
159
160 void run(void) {
161   for (int i=0; i<10; ++i)
162     output[i] = input[i] * 2;
163 }
164           \end{Verbatim}
165         \end{column}
166       \end{columns}
167     \end{frame}
168     \note{} % Empty filler note page
169
170     \begin{frame}{What is Montium IR?}
171       \begin{itemize}
172         \item Status: Initial version
173         \item Challenges:
174         \begin{itemize}
175           \item Backend is a fast moving target
176           \item Corner cases
177           \note[item]{Corner case --- global constants}
178           \item Hardware dependencies
179           \note[item]{Hardware --- Limited number of conditionals possible}
180         \end{itemize}
181       \end{itemize}
182     \end{frame}
183
184     \begin{frame}{Selecting LLVM transformations}
185       \begin{itemize}
186         \item Status: Done
187         \item Challenges:
188         \begin{itemize}
189           \item LLVM Passes assume a lot
190           \note[item]{Assumptions --- Immediates are not free}
191           \item Montium has specific constraints
192           \note[item]{Constraint --- Implicit cycle boundaries and ordering}
193         \end{itemize}
194       \end{itemize}
195     \end{frame}
196
197     \begin{frame}{Improving / adding transformations}
198       \begin{itemize}
199         \item Status: Ongoing
200         \item Challenges:
201         \begin{itemize}
202           \item Staying generic
203           \note[item]{Generic --- LLVM maintained passes are a lot easier}
204           \item New LLVM features
205           \note[item]{Features --- Multiple return values, inlining and
206           annotation attributes}
207         \end{itemize}
208       \end{itemize}
209     \end{frame}
210
211     \begin{frame}{Debugging information}
212       \begin{itemize}
213         \item Status: Not started
214         \item Challenges:
215         \begin{itemize}
216           \item Not much LLVM support yet
217           \note[item]{LLVM support --- New in clang/backend, no support in
218           transformations yet.}
219           \item Transformations
220           \note[item]{Transformations --- Global arguments, argument addition,
221           removal, etc.}
222         \end{itemize}
223       \end{itemize}
224     \end{frame}
225
226     \begin{frame}{Reconfigurable binaries}
227       \begin{itemize}
228         \item Status: Recently started
229         \item Challenges:
230         \begin{itemize}
231           \item Tracking variables
232           \note[item]{Tracking --- Through all steps of the process}
233           \item Loss of optimizations
234           \note[item]{Optimizations --- Hard to encode constraints}
235           \item Mostly a backend problem
236         \end{itemize}
237       \end{itemize}
238     \end{frame}
239
240 \section{Work process}
241   \begin{frame}{Working at Recore}
242     \begin{itemize}
243       \item Smart people
244       \item Fast communication
245       \note[item]{Communication --- Mixed teams, easy to "listen in".}
246       \item Constructive brainstorming
247       \note[item]{Brainstorming --- Evaluating different ideas and approaches.}
248     \end{itemize}
249   \end{frame}
250
251   \begin{frame}{Working with LLVM}
252     \begin{itemize}
253       \item Large community
254       \note[item]{Community --- Companies involved, a lot of full time
255       developers.}
256       \item Great support
257       \note[item]{Support --- mailing list, bug reports solved within 1/2 days.}
258       \item Slightly conflicting goals
259       \note[item]{Goals --- LLVM aims mainly at "regular" architectures.}
260     \end{itemize}
261   \end{frame}
262
263 \section{Conclusions}
264   \begin{frame}{Conclusions}
265     \begin{itemize}
266       \item LLVM is very suitable
267       \item Defining the problem is harder than solving it
268       \item Three months is short!
269     \end{itemize}
270   \end{frame}
271
272 \end{document}