Hopefully fix a link.
[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="#code-cleanups">Implementing Code Cleanup bugs</a></li>
19     <li><a href="#glibc">Port glibc to LLVM</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="#target">Target backend improvements</a></li>
23     <li><a href="#misc_imp">Miscellaneous Improvements</a></li>
24   </ol></li>
25
26   <li><a href="#new">Adding new capabilities to LLVM</a>
27   <ol>
28     <li><a href="#newfeaturebugs">Implementing new feature PRs</a></li>
29     <li><a href="#pointeranalysis">Pointer and Alias Analysis</a></li>
30     <li><a href="#profileguided">Profile-Guided Optimization</a></li>
31     <li><a href="#xforms">New Transformations and Analyses</a></li>
32     <li><a href="#x86be">X86 Back-end Improvements</a></li>
33     <li><a href="#misc_new">Miscellaneous Additions</a></li>
34   </ol></li>
35 </ul>
36
37 <div class="doc_author">
38   <p>Written by the <a href="http://llvm.cs.uiuc.edu/">LLVM Team</a></p>
39 </div>
40
41
42 <!-- *********************************************************************** -->
43 <div class="doc_section">
44   <a name="what">What is this?</a>
45 </div>
46 <!-- *********************************************************************** -->
47
48 <div class="doc_text">
49
50 <p>This document is meant to be a sort of "big TODO list" for LLVM.  Each
51 project in this document is something that would be useful for LLVM to have, and
52 would also be a great way to get familiar with the system.  Some of these
53 projects are small and self-contained, which may be implemented in a couple of
54 days, others are larger.  Several of these projects may lead to interesting
55 research projects in their own right.  In any case, we welcome all
56 contributions.</p>
57
58 <p>If you are thinking about tackling one of these projects, please send a mail
59 to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
60 Developer's</a> mailing list, so that we know the project is being worked on.
61 Additionally this is a good way to get more information about a specific project
62 or to suggest other projects to add to this page.
63 </p>
64
65 <p>The projects in this page are open-ended. More specific projects are
66 filed as unassigned enhancements in the <a href="http://llvm.cs.uiuc.edu/bugs/">
67 LLVM bug tracker</a>. See the <a href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?keywords_type=allwords&amp;keywords=&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_severity=enhancement&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=unassigned">list of currently outstanding issues</a> if you wish to help improve LLVM.</p>
68
69 </div>
70
71 <!-- *********************************************************************** -->
72 <div class="doc_section">
73   <a name="improving">Improving the current system</a>
74 </div>
75 <!-- *********************************************************************** -->
76
77 <div class="doc_text">
78
79 <p>Improvements to the current infrastructure are always very welcome and tend
80 to be fairly straight-forward to implement.  Here are some of the key areas that
81 can use improvement...</p>
82
83 </div>
84
85 <!-- ======================================================================= -->
86 <div class="doc_subsection">
87   <a name="code-cleanups">Implementing Code Cleanup bugs</a>
88 </div>
89
90 <div class="doc_text">
91
92 <p>
93 The <a href="http://llvm.cs.uiuc.edu/bugs/">LLVM bug tracker</a> occasionally
94 has <a
95   href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;status_whiteboard_type=allwordssubstr&amp;status_whiteboard=&amp;keywords_type=allwords&amp;keywords=code-cleanup&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;cmdtype=doit&amp;order=Bug+Number&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">"code-cleanup" bugs</a> filed in it.  Taking one of these and fixing it is a good
96 way to get your feet wet in the LLVM code and discover how some of its components
97 work.
98 </p>
99
100 </div>
101
102 <!-- ======================================================================= -->
103 <div class="doc_subsection">
104   <a name="glibc">Port glibc to LLVM</a>
105 </div>
106
107 <div class="doc_text">
108
109 <p>It would be very useful to <a
110 href="http://www.gnu.org/software/libc/manual/html_node/Porting.html">port</a> <a
111 href="http://www.gnu.org/software/libc/">glibc</a> to LLVM.  This would allow a
112 variety of interprocedural algorithms to be much more effective in the face of
113 library calls.  The most important pieces to port are things like the string
114 library and the <tt>stdio</tt> related functions... low-level system calls like
115 '<tt>read</tt>' should stay unimplemented in LLVM.</p>
116
117 </div>
118
119 <!-- ======================================================================= -->
120 <div class="doc_subsection">
121   <a name="programs">Compile programs with the LLVM Compiler</a>
122 </div>
123
124 <div class="doc_text">
125
126 <p>We are always looking for new testcases and benchmarks for use with LLVM.  In
127 particular, it is useful to try compiling your favorite C source code with LLVM.
128 If it doesn't compile, try to figure out why or report it to the <a
129 href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">llvm-bugs</a> list.  If you
130 get the program to compile, it would be extremely useful to convert the build
131 system to be compatible with the LLVM Programs testsuite so that we can check it
132 into CVS and the automated tester can use it to track progress of the
133 compiler.</p>
134
135 <p>When testing a code, try running it with a variety of optimizations, and with
136 all the back-ends: CBE, llc, and lli.</p>
137
138 </div>
139
140 <!-- ======================================================================= -->
141 <div class="doc_subsection">
142   <a name="llvm_ir">Extend the LLVM intermediate representation</a>
143 </div>
144
145 <div class="doc_text">
146
147 <ol>
148 <li>Add support for platform-independent prefetch support.  The GCC <a
149     href="http://gcc.gnu.org/projects/prefetch.html">prefetch project</a> page
150     has a good survey of the prefetching capabilities of a variety of modern
151     processors.</li>
152
153 </ol>
154
155 </div>
156
157 <!-- ======================================================================= -->
158 <div class="doc_subsection">
159   <a name="target">Target backend improvements</a>
160 </div>
161
162 <div class="doc_text">
163
164 <ol>
165   <li>Find benchmarks either using our <a
166   href="http://llvm.cs.uiuc.edu/testresults/">test results</a> or on your own,
167   where LLVM code generators do not produce optimal code or simply where another
168   compiler produces better code.  Try to minimize the test case that
169   demonstrates the issue.  Then, either <a
170   href="http://llvm.cs.uiuc.edu/bugs/">submit a bug</a> with your testcase and
171   the code that LLVM produces vs. the code that it <em>should</em> produce, or
172   even better, see if you can improve the code generator and submit a
173   patch.</li>
174 </ol>
175
176 </div>
177
178 <!-- ======================================================================= -->
179 <div class="doc_subsection">
180   <a name="misc_imp">Miscellaneous Improvements</a>
181 </div>
182
183 <div class="doc_text">
184
185 <ol>
186 <li>Rework the PassManager to be more flexible</li>
187
188 <li>Some transformations and analyses only work on reducible flow graphs.  It
189 would be nice to have a transformation which could be "required" by these passes
190 which makes irreducible graphs reducible.  This can easily be accomplished
191 through code duplication.  See <a
192 href="http://citeseer.nj.nec.com/janssen97making.html">Making Graphs Reducible
193 with Controlled Node Splitting</a> and perhaps <a
194 href="http://doi.acm.org/10.1145/262004.262005">Nesting of Reducible and
195 Irreducible Loops</a>.</li>
196
197 </ol>
198
199 </div>
200
201 <!-- *********************************************************************** -->
202 <div class="doc_section">
203   <a name="new">Adding new capabilities to LLVM</a>
204 </div>
205 <!-- *********************************************************************** -->
206
207 <div class="doc_text">
208
209 <p>Sometimes creating new things is more fun than improving existing things.
210 These projects tend to be more involved and perhaps require more work, but can
211 also be very rewarding.</p>
212
213 </div>
214
215
216 <!-- ======================================================================= -->
217 <div class="doc_subsection">
218   <a name="newfeaturebugs">Implementing new feature PRs</a>
219 </div>
220
221 <div class="doc_text">
222
223 <p>Many ideas for feature requests are stored in LLVM bugzilla.  Just <a
224   href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;status_whiteboard_type=allwordssubstr&amp;status_whiteboard=&amp;keywords_type=allwords&amp;keywords=new-feature&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;cmdtype=doit&amp;namedcmd=All+PRs&amp;newqueryname=&amp;order=Bug+Number&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">search for bugs with a "new-feature" keyword</a>.</p>
225
226 </div>
227
228 <!-- ======================================================================= -->
229 <div class="doc_subsection">
230   <a name="pointeranalysis">Pointer and Alias Analysis</a>
231 </div>
232
233 <div class="doc_text">
234
235 <p>We have a <a href="AliasAnalysis.html">strong base for development</a> of
236 both pointer analysis based optimizations as well as pointer analyses
237 themselves.  It seems natural to want to take advantage of this...</p>
238
239 <ol>
240 <li>Implement a flow-sensitive context-sensitive alias analysis algorithm<br>
241   - Pick one of the somewhat efficient algorithms, but strive for maximum
242     precision</li>
243
244 <li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
245   - Just an efficient local algorithm perhaps?</li>
246
247 <li>Implement alias-analysis-based optimizations:
248   <ul>
249   <li>...</li>
250   </ul></li>
251 </ol>
252
253 </div>
254
255 <!-- ======================================================================= -->
256 <div class="doc_subsection">
257   <a name="profileguided">Profile-Guided Optimization</a>
258 </div>
259
260 <div class="doc_text">
261
262 <p>We now have a unified infrastructure for writing profile-guided
263 transformations, which will work either at offline-compile-time or in the JIT,
264 but we don't have many transformations.  We would welcome new profile-guided
265 transformations as well as improvements to the current profiling system.
266 </p>
267
268 <p>Ideas for profile-guided transformations:</p>
269
270 <ol>
271 <li>Superblock formation (with many optimizations)</li>
272 <li>Loop unrolling/peeling</li>
273 <li>Profile directed inlining</li>
274 <li>Code layout</li>
275 <li>...</li>
276 </ol>
277
278 <p>Improvements to the existing support:</p>
279
280 <ol>
281 <li>The current block and edge profiling code that gets inserted is very simple
282 and inefficient.  Through the use of control-dependence information, many fewer
283 counters could be inserted into the code.  Also, if the execution count of a
284 loop is known to be a compile-time or runtime constant, all of the counters in
285 the loop could be avoided.</li>
286
287 <li>You could implement one of the "static profiling" algorithms which analyze a
288 piece of code an make educated guesses about the relative execution frequencies
289 of various parts of the code.</li>
290
291 <li>You could add path profiling support, or adapt the existing LLVM path
292 profiling code to work with the generic profiling interfaces.</li>
293 </ol>
294
295 </div>
296
297 <!-- ======================================================================= -->
298 <div class="doc_subsection">
299   <a name="xforms">New Transformations and Analyses</a>
300 </div>
301
302 <div class="doc_text">
303
304 <ol>
305 <li>Implement <a href="http://www.cs.purdue.edu/homes/vandrutj/">GVN-PRE</a>, a 
306   powerful and simple Partial Redundancy Elimination algorithm for SSA form</li>
307 <li>Implement a Dependence Analysis Infrastructure<br>
308      - Design some way to represent and query dep analysis</li>
309 <li>Implement a strength reduction pass</li>
310 <li>Value range propagation pass</li>
311 </ol>
312
313 </div>
314
315 <!-- ======================================================================= -->
316 <div class="doc_section">
317   <a name="x86be">X86 Back-end Improvements</a>
318 </div>
319
320 <div class="doc_text">
321
322 <ol>
323 <li>Implement a better instruction selector</li>
324 <li>Implement support for the "switch" instruction without requiring the 
325     lower-switches pass.</li>
326 <li>Implement interprocedural register allocation. The CallGraphSCCPass can be
327     used to implement a bottom-up analysis that will determine the *actual* 
328     registers clobbered by a function. Use the pass to fine tune register usage 
329     in callers based on *actual* registers used by the callee.</li>
330 </ol>
331
332 </div>
333
334 <!-- ======================================================================= -->
335 <div class="doc_section">
336   <a name="misc_new">Miscellaneous Additions</a>
337 </div>
338
339 <div class="doc_text">
340
341 <ol>
342 <li>Port the <a href="http://www-sop.inria.fr/mimosa/fp/Bigloo/">Bigloo</A>
343 Scheme compiler, from Manuel Serrano at INRIA Sophia-Antipolis, to
344 output LLVM bytecode. It seems that it can already output .NET
345 bytecode, JVM bytecode, and C, so LLVM would ostensibly be another good
346 candidate.</li>
347 <li>Write a new frontend for C/C++ <b>in</b> C++, giving us the ability to
348 directly use LLVM C++ classes from within a compiler rather than use
349 C-based wrapper functions a la llvm-gcc.  One possible starting point is the <a
350 href="http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-37.11">C++
351 yacc grammar by Ed Willink</a>.</li>
352 <li>Write a new frontend for some other language (Java? OCaml? Forth?)</li>
353 <li>Write a new backend for a target (IA64? MIPS? MMIX?)</li>
354 <li>Write a disassembler for machine code that would use TableGen to output 
355 <tt>MachineInstr</tt>s for transformations, optimizations, etc.</li>
356 <li>Random test vector generator: Use a C grammar to generate random C code;
357 run it through llvm-gcc, then run a random set of passes on it using opt.
358 Try to crash opt. When opt crashes, use bugpoint to reduce the test case and
359 mail the result to yourself.  Repeat ad infinitum.</li>
360 <li>Design a simple, recognizable logo.</li>
361 <li>Improve the usefulness and utility of the Skeleton target backend:
362 <ul>
363   <li>Convert the non-functional Skeleton target to become an abstract machine
364   target (choose some simple instructions, a register set, etc).  This will
365   become a much more useful example of a backend since it would be a simple
366   but <em>functional</em> backend.  Examples of such architectures include MIX,
367   MMIX, <a
368   href="http://www.cs.cinvestav.mx/SC/prof_personal/adiaz/vhdl/DLX/">DLX</a>,
369   or come up with your own!</li>
370   <li>Use the new Skeleton backend in the Interpreter: compile LLVM to Skeleton
371   target, and then interpret that code instead of LLVM.  Performance win would
372   be the primary goal, as the number of registers would be a small constant
373   instead of unbounded, for example.</li>
374 </ul></li>
375 </ol>
376
377 </div>
378
379 <!-- *********************************************************************** -->
380
381 <hr>
382 <address>
383   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
384   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
385   <a href="http://validator.w3.org/check/referer"><img
386   src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
387
388   <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
389   <a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
390   Last modified: $Date$
391 </address>
392
393 </body>
394 </html>