Reid implemented this.
[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="#programs">Compile programs with the LLVM Compiler</a></li>
20     <li><a href="#llvm_ir">Extend the LLVM intermediate representation</a></li>
21     <li><a href="#misc_imp">Miscellaneous Improvements</a></li>
22   </ol></li>
23
24   <li><a href="#new">Adding new capabilities to LLVM</a>
25   <ol>
26     <li><a href="#pointeranalysis">Pointer and Alias Analysis</a></li>
27     <li><a href="#profileguided">Profile Guided Optimization</a></li>
28     <li><a href="#xforms">New Transformations and Analyses</a></li>
29     <li><a href="#x86be">X86 Back-end Improvements</a></li>
30     <li><a href="#misc_new">Miscellaneous Additions</a></li>
31   </ol></li>
32 </ul>
33
34 <div class="doc_author">
35   <p>Written by the <a href="http://llvm.cs.uiuc.edu/">LLVM Team</a></p>
36 </div>
37
38
39 <!-- *********************************************************************** -->
40 <div class="doc_section">
41   <a name="what">What is this?</a>
42 </div>
43 <!-- *********************************************************************** -->
44
45 <div class="doc_text">
46
47 <p>This document is meant to be a sort of "big TODO list" for LLVM.  Each
48 project in this document is something that would be useful for LLVM to have, and
49 would also be a great way to get familiar with the system.  Some of these
50 projects are small and self-contained, which may be implemented in a couple of
51 days, others are larger.  Several of these projects may lead to interesting
52 research projects in their own right.  In any case, we welcome all
53 contributions.</p>
54
55 <p>If you are thinking about tackling one of these projects, please send a mail
56 to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
57 Developer's</a> mailing list, so that we know the project is being worked on.
58 Additionally this is a good way to get more information about a specific project
59 or to suggest other projects to add to this page.
60 </p>
61
62 <p>The projects in this page are open-ended. More specific projects are
63 filed as unassigned enhancements in the <a href="http://llvm.cs.uiuc.edu/bugs/">
64 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>
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="programs">Compile programs with the LLVM Compiler</a>
102 </div>
103
104 <div class="doc_text">
105
106 <p>We are always looking for new testcases and benchmarks for use with LLVM.  In
107 particular, it is useful to try compiling your favorite C source code with LLVM.
108 If it doesn't compile, try to figure out why or report it to the <a
109 href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">llvm-bugs</a> list.  If you
110 get the program to compile, it would be extremely useful to convert the build
111 system to be compatible with the LLVM Programs testsuite so that we can check it
112 into CVS and the automated tester can use it to track progress of the
113 compiler.</p>
114
115 <p>When testing a code, try running it with a variety of optimizations, and with
116 all the back-ends: CBE, llc, and lli.</p>
117
118 </div>
119
120 <!-- ======================================================================= -->
121 <div class="doc_subsection">
122   <a name="llvm_ir">Extend the LLVM intermediate representation</a>
123 </div>
124
125 <div class="doc_text">
126
127 <ol>
128 <li>Add support for platform-independent prefetch support.  The GCC <a
129     href="http://gcc.gnu.org/projects/prefetch.html">prefetch project</a> page
130     has a good survey of the prefetching capabilities of a variety of modern
131     processors.</li>
132
133 </ol>
134
135 </div>
136
137 <!-- ======================================================================= -->
138 <div class="doc_subsection">
139   <a name="misc_imp">Miscellaneous Improvements</a>
140 </div>
141
142 <div class="doc_text">
143
144 <ol>
145 <li>Someone needs to look into getting the <tt>ranlib</tt> tool to index LLVM
146     bytecode files, so that linking in .a files is not hideously slow.  They
147     would also then have to implement the reader for this index in
148     <tt>gccld</tt>.</li>
149
150 <li>Rework the PassManager to be more flexible</li>
151
152 <li>Some transformations and analyses only work on reducible flow graphs.  It
153 would be nice to have a transformation which could be "required" by these passes
154 which makes irreducible graphs reducible.  This can easily be accomplished
155 through code duplication.  See <a
156 href="http://citeseer.nj.nec.com/janssen97making.html">Making Graphs Reducible
157 with Controlled Node Splitting</a> and perhaps <a
158 href="http://doi.acm.org/10.1145/262004.262005">Nesting of Reducible and
159 Irreducible Loops</a>.</li>
160
161 </ol>
162
163 </div>
164
165 <!-- *********************************************************************** -->
166 <div class="doc_section">
167   <a name="new">Adding new capabilities to LLVM</a>
168 </div>
169 <!-- *********************************************************************** -->
170
171 <div class="doc_text">
172
173 <p>Sometimes creating new things is more fun than improving existing things.
174 These projects tend to be more involved and perhaps require more work, but can
175 also be very rewarding.</p>
176
177 </div>
178
179 <!-- ======================================================================= -->
180 <div class="doc_subsection">
181   <a name="pointeranalysis">Pointer and Alias Analysis</a>
182 </div>
183
184 <div class="doc_text">
185
186 <p>We have a <a href="AliasAnalysis.html">strong base for development</a> of
187 both pointer analysis based optimizations as well as pointer analyses
188 themselves.  It seems natural to want to take advantage of this...</p>
189
190 <ol>
191 <li>Implement a flow-sensitive context-sensitive alias analysis algorithm<br>
192   - Pick one of the somewhat efficient algorithms, but strive for maximum
193     precision</li>
194
195 <li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
196   - Just an efficient local algorithm perhaps?</li>
197
198 <li>Implement alias-analysis-based optimizations:
199   <ul>
200   <li>Dead store elimination</li>
201   <li>...</li>
202   </ul></li>
203 </ol>
204
205 </div>
206
207 <!-- ======================================================================= -->
208 <div class="doc_subsection">
209   <a name="profileguided">Profile Guided Optimization</a>
210 </div>
211
212 <div class="doc_text">
213
214 <p>We now have a unified infrastructure for writing profile-guided
215 transformations, which will work either at offline-compile-time or in the JIT,
216 but we don't have many transformations.  We would welcome new profile-guided
217 transformations as well as improvements to the current profiling system.
218 </p>
219
220 <p>Ideas for profile guided transformations:</p>
221
222 <ol>
223 <li>Superblock formation (with many optimizations)</li>
224 <li>Loop unrolling/peeling</li>
225 <li>Profile directed inlining</li>
226 <li>Code layout</li>
227 <li>...</li>
228 </ol>
229
230 <p>Improvements to the existing support:</p>
231
232 <ol>
233 <li>The current block and edge profiling code that gets inserted is very simple
234 and inefficient.  Through the use of control-dependence information, many fewer
235 counters could be inserted into the code.  Also, if the execution count of a
236 loop is known to be a compile-time or runtime constant, all of the counters in
237 the loop could be avoided.</li>
238
239 <li>You could implement one of the "static profiling" algorithms which analyze a
240 piece of code an make educated guesses about the relative execution frequencies
241 of various parts of the code.</li>
242
243 <li>You could add path profiling support, or adapt the existing LLVM path
244 profiling code to work with the generic profiling interfaces.</li>
245 </ol>
246
247 </div>
248
249 <!-- ======================================================================= -->
250 <div class="doc_subsection">
251   <a name="xforms">New Transformations and Analyses</a>
252 </div>
253
254 <div class="doc_text">
255
256 <ol>
257 <li>Implement a Dependence Analysis Infrastructure<br>
258      - Design some way to represent and query dep analysis</li>
259 <li>Implement a strength reduction pass</li>
260 <li>Value range propagation pass</li>
261 </ol>
262
263 </div>
264
265 <!-- ======================================================================= -->
266 <div class="doc_section">
267   <a name="x86be">X86 Back-end Improvements</a>
268 </div>
269
270 <div class="doc_text">
271
272 <ol>
273 <li>Implement a better instruction selector</li>
274 <li>Implement support for the "switch" instruction without requiring the 
275     lower-switches pass.</li>
276 </ol>
277
278 </div>
279
280 <!-- ======================================================================= -->
281 <div class="doc_section">
282   <a name="misc_new">Miscellaneous Additions</a>
283 </div>
284
285 <div class="doc_text">
286
287 <ol>
288 <li>Port the <A HREF="http://www-sop.inria.fr/mimosa/fp/Bigloo/">Bigloo</A>
289 Scheme compiler, from Manuel Serrano at INRIA Sophia-Antipolis, to
290 output LLVM bytecode. It seems that it can already output .NET
291 bytecode, JVM bytecode, and C, so LLVM would ostensibly be another good
292 candidate.</li>
293 <li>Write a new frontend for some other language (Java? OCaml? Forth?)</li>
294 <li>Write a new backend for a target (IA64? MIPS? MMIX?)</li>
295 <li>Write a disassembler for machine code that would use TableGen to output 
296 <tt>MachineInstr</tt>s for transformations, optimizations, etc.</li>
297 <li>Random test vector generator: Use a C grammar to generate random C code;
298 run it through llvm-gcc, then run a random set of passes on it using opt.
299 Try to crash opt. When opt crashes, use bugpoint to reduce the test case and
300 mail the result to yourself.  Repeat ad infinitum.</li>
301 <li>Design a simple, recognizable logo.</li>
302 </ol>
303
304 </div>
305
306 <!-- *********************************************************************** -->
307
308 <hr>
309 <address>
310   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
311   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
312   <a href="http://validator.w3.org/check/referer"><img
313   src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
314
315   <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
316   <a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
317   Last modified: $Date$
318 </address>
319
320 </body>
321 </html>