b61460bd6feb03372aef7899ce65695071785cc7
[oota-llvm.git] / docs / OpenProjects.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                       "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5   <title>Open LLVM Projects</title>
6   <link rel="stylesheet" href="llvm.css" type="text/css">
7 </head>
8 <body>
9
10 <div class="doc_title">
11   Open LLVM Projects
12 </div>
13
14 <ul>
15   <li><a href="#what">What is this?</a></li>
16   <li><a href="#improving">Improving the current system</a>
17   <ol>
18     <li><a href="#glibc">Port glibc to LLVM</a></li>
19     <li><a href="#NightlyTest">Improving the Nightly Tester</a></li>
20     <li><a href="#programs">Compile programs with the LLVM Compiler</a></li>
21     <li><a href="#llvm_ir">Extend the LLVM intermediate representation</a></li>
22     <li><a href="#misc_imp">Miscellaneous Improvements</a></li>
23   </ol></li>
24
25   <li><a href="#new">Adding new capabilities to LLVM</a>
26   <ol>
27     <li><a href="#pointeranalysis">Pointer and Alias Analysis</a></li>
28     <li><a href="#profileguided">Profile Guided Optimization</a></li>
29     <li><a href="#xforms">New Transformations and Analyses</a></li>
30     <li><a href="#x86be">X86 Back-end Improvements</a></li>
31     <li><a href="#misc_new">Miscellaneous Additions</a></li>
32   </ol></li>
33 </ul>
34
35 <!-- *********************************************************************** -->
36 <div class="doc_section">
37   <a name="what">What is this?</a>
38 </div>
39 <!-- *********************************************************************** -->
40
41 <div class="doc_text">
42
43 <p>This document is meant to be a sort of "big TODO list" for LLVM.  Each
44 project in this document is something that would be useful for LLVM to have, and
45 would also be a great way to get familiar with the system.  Some of these
46 projects are small and self-contained, which may be implemented in a couple of
47 days, others are larger.  Several of these projects may lead to interesting
48 research projects in their own right.  In any case, we welcome all
49 contributions.</p>
50
51 <p>If you are thinking about tackling one of these projects, please send a mail
52 to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
53 Developer's</a> mailing list, so that we know the project is being worked on.
54 Additionally this is a good way to get more information about a specific project
55 or to suggest other projects to add to this page.
56 </p>
57
58 <p>The projects in this page are open ended. More specific projects are
59 filed as unassigned enhancements in our <a href="http://llvm.cs.uiuc.edu/bugs/">
60 LLVM bug tracker</a>. Here is the current list:
61 </p>
62
63 <iframe src="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?keywords_type=allwords&keywords=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=enhancement&emailassigned_to1=1&emailtype1=substring&email1=unassigned" frameborder="1" align="center" width="100%" height="400">
64 </iframe>
65
66 </div>
67
68 <!-- *********************************************************************** -->
69 <div class="doc_section">
70   <a name="improving">Improving the current system</a>
71 </div>
72 <!-- *********************************************************************** -->
73
74 <div class="doc_text">
75
76 <p>Improvements to the current infrastructure are always very welcome and tend
77 to be fairly straight-forward to implement.  Here are some of the key areas that
78 can use improvement...</p>
79
80 </div>
81
82 <!-- ======================================================================= -->
83 <div class="doc_subsection">
84   <a name="glibc">Port glibc to LLVM</a>
85 </div>
86
87 <div class="doc_text">
88
89 <p>It would be very useful to <a
90 href="http://www.gnu.org/software/libc/porting.html">port</a> <a
91 href="http://www.gnu.org/software/glibc/">glibc</a> to LLVM.  This would allow a
92 variety of interprocedural algorithms to be much more effective in the face of
93 library calls.  The most important pieces to port are things like the string
94 library and the <tt>stdio</tt> related functions... low-level system calls like
95 '<tt>read</tt>' should stay unimplemented in LLVM.</p>
96
97 </div>
98
99 <!-- ======================================================================= -->
100 <div class="doc_subsection">
101   <a name="NightlyTest">Improving the Nightly Tester</a>
102 </div>
103
104 <div class="doc_text">
105
106 <p>The <a href="/testresults/">Nightly Tester</a> is a simple perl script
107 (located in <tt>utils/NightlyTest.pl</tt>) which runs every night to generate a
108 daily report.  It could use the following improvements:</p>
109
110 <ol>
111 <li>Regression tests - We should run the regression tests in addition to the
112     program tests...</li>
113 </ol>
114
115 </div>
116
117 <!-- ======================================================================= -->
118 <div class="doc_subsection">
119   <a name="programs">Compile programs with the LLVM Compiler</a>
120 </div>
121
122 <div class="doc_text">
123
124 <p>We are always looking for new testcases and benchmarks for use with LLVM.  In
125 particular, it is useful to try compiling your favorite C source code with LLVM.
126 If it doesn't compile, try to figure out why or report it to the <a
127 href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">llvm-bugs</a> list.  If you
128 get the program to compile, it would be extremely useful to convert the build
129 system to be compatible with the LLVM Programs testsuite so that we can check it
130 into CVS and the automated tester can use it to track progress of the
131 compiler.</p>
132
133 <p>When testing a code, try running it with a variety of optimizations, and with
134 all the back-ends: CBE, llc, and lli.</p>
135
136 </div>
137
138 <!-- ======================================================================= -->
139 <div class="doc_subsection">
140   <a name="llvm_ir">Extend the LLVM intermediate representation</a>
141 </div>
142
143 <div class="doc_text">
144
145 <ol>
146
147 <li>Add a new conditional move instruction: <tt>X = select bool Cond, Y,
148     Z</tt></li>
149
150 <li>Add support for platform-independent prefetch support.  The GCC <a
151     href="http://gcc.gnu.org/projects/prefetch.html">prefetch project</a> page
152     has a good survey of the prefetching capabilities of a variety of modern
153     processors.</li>
154
155 </ol>
156
157 </div>
158
159 <!-- ======================================================================= -->
160 <div class="doc_subsection">
161   <a name="misc_imp">Miscellaneous Improvements</a>
162 </div>
163
164 <div class="doc_text">
165
166 <ol>
167 <li>Someone needs to look into getting the <tt>ranlib</tt> tool to index LLVM
168     bytecode files, so that linking in .a files is not hideously slow.  They
169     would also then have to implement the reader for this index in
170     <tt>gccld</tt>.</li>
171
172 <li>Rework the PassManager to be more flexible</li>
173
174 <li>Some transformations and analyses only work on reducible flow graphs.  It
175 would be nice to have a transformation which could be "required" by these passes
176 which makes irreducible graphs reducible.  This can easily be accomplished
177 through code duplication.  See <a
178 href="http://citeseer.nj.nec.com/janssen97making.html">Making Graphs Reducible
179 with Controlled Node Splitting</a> and perhaps <a
180 href="http://doi.acm.org/10.1145/262004.262005">Nesting of Reducible and
181 Irreducible Loops</a>.</li>
182
183 </ol>
184
185 </div>
186
187 <!-- *********************************************************************** -->
188 <div class="doc_section">
189   <a name="new">Adding new capabilities to LLVM</a>
190 </div>
191 <!-- *********************************************************************** -->
192
193 <div class="doc_text">
194
195 <p>Sometimes creating new things is more fun that improving existing things.
196 These projects tend to be more involved and perhaps require more work, but can
197 also be very rewarding.</p>
198
199 </div>
200
201 <!-- ======================================================================= -->
202 <div class="doc_subsection">
203   <a name="pointeranalysis">Pointer and Alias Analysis</a>
204 </div>
205
206 <div class="doc_text">
207
208 <p>We have a <a href="AliasAnalysis.html">strong base for development</a> of
209 both pointer analysis based optimizations as well as pointer analyses
210 themselves.  It seems natural to want to take advantage of this...</p>
211
212 <ol>
213 <li>Implement a flow-sensitive context-sensitive alias analysis algorithm<br>
214   - Pick one of the somewhat efficient algorithms, but strive for maximum
215     precision</li>
216
217 <li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
218   - Just an efficient local algorithm perhaps?</li>
219
220 <li>Implement an interface to update analyses in response to common code motion
221     transformations</li>
222
223 <li>Implement alias-analysis-based optimizations:
224   <ul>
225   <li>Dead store elimination</li>
226   <li>...</li>
227   </ul></li>
228 </ol>
229
230 </div>
231
232 <!-- ======================================================================= -->
233 <div class="doc_subsection">
234   <a name="profileguided">Profile Guided Optimization</a>
235 </div>
236
237 <div class="doc_text">
238
239 <p>We now have a unified infrastructure for writing profile-guided
240 transformations, which will work either at offline-compile-time or in the JIT,
241 but we don't have many transformations.  We would welcome new profile-guided
242 transformations as well as improvements to the current profiling system.
243 </p>
244
245 <p>Ideas for profile guided transformations:</p>
246
247 <ol>
248 <li>Superblock formation (with many optimizations)</li>
249 <li>Loop unrolling/peeling</li>
250 <li>Profile directed inlining</li>
251 <li>Code layout</li>
252 <li>...</li>
253 </ol>
254
255 <p>Improvements to the existing support:</p>
256
257 <ol>
258 <li>The current block and edge profiling code that gets inserted is very simple
259 and inefficient.  Through the use of control-dependence information, many fewer
260 counters could be inserted into the code.  Also, if the execution count of a
261 loop is known to be a compile-time or runtime constant, all of the counters in
262 the loop could be avoided.</li>
263
264 <li>You could implement one of the "static profiling" algorithms which analyze a
265 piece of code an make educated guesses about the relative execution frequencies
266 of various parts of the code.</li>
267
268 <li>You could add path profiling support, or adapt the existing LLVM path
269 profiling code to work with the generic profiling interfaces.</li>
270 </ol>
271
272 </div>
273
274 <!-- ======================================================================= -->
275 <div class="doc_subsection">
276   <a name="xforms">New Transformations and Analyses</a>
277 </div>
278
279 <div class="doc_text">
280
281 <ol>
282 <li>Implement a Dependence Analysis Infrastructure<br>
283      - Design some way to represent and query dep analysis</li>
284 <li>Implement a strength reduction pass</li>
285 <li>Value range propagation pass</li>
286 <li>Implement an unswitching pass</li>
287 <li>Write a loop unroller, with a simple heuristic for when to unroll</li>
288 </ol>
289
290 </div>
291
292 <!-- ======================================================================= -->
293 <div class="doc_section">
294   <a name="x86be">X86 Back-end Improvements</a>
295 </div>
296
297 <div class="doc_text">
298
299 <ol>
300 <li>Implement a global register allocator</li>
301 <li>Implement a better instruction selector</li>
302 <li>Implement support for the "switch" instruction without requiring the 
303     lower-switches pass.</li>
304 </ol>
305
306 </div>
307
308 <!-- ======================================================================= -->
309 <div class="doc_section">
310   <a name="misc_new">Miscellaneous Additions</a>
311 </div>
312
313 <div class="doc_text">
314
315 <ol>
316 <li>Write a new frontend for some language (Java? OCaml? Forth?)</li>
317 <li>Write a new backend for a target (IA64? MIPS? MMIX?)</li>
318 <li>Random test vector generator: Use a C grammar to generate random C code;
319 run it through llvm-gcc, then run a random set of passes on it using opt.
320 Try to crash opt. When opt crashes, use bugpoint to reduce the test case and
321 mail the result to yourself.  Repeat ad infinitum.</li>
322 <li>Design a simple, recognizable logo.</li>
323 </ol>
324
325 </div>
326
327 <!-- *********************************************************************** -->
328
329 <hr>
330 <div class="doc_footer">
331   <address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
332   <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
333   <br>
334   Last modified: $Date$
335 </div>
336
337 </body>
338 </html>