# Open LLVM Projects

- What is this?
- Improving the current system
  1. Port glibc to LLVM
  2. Improving the Nightly Tester
  3. Compile programs with the LLVM Compiler
  4. Extend the LLVM intermediate representation
  5. Miscellaneous Improvements
- Adding new capabilities to LLVM
  1. Pointer and Alias Analysis
  2. Profile Guided Optimization
  3. New Transformations and Analyses
  4. X86 Back-end Improvements
  5. Miscellaneous Additions

What is this?

This document is meant to be a sort of "big TODO list" for LLVM. Each project in this document is something that would be useful for LLVM to have, and would also be a great way to get familiar with the system. Some of these projects are small and self-contained, which may be implemented in a couple of days, others are larger. Several of these projects may lead to interesting research projects in their own right. In any case, we welcome all contributions.

If you are thinking about tackling one of these projects, please send a mail to the LLVM Developer's mailing list, so that we know the project is being worked on. Additionally this is a good way to get more information about a specific project or to suggest other projects to add to this page.

Improving the current system

Improvements to the current infrastructure are always very welcome and tend to be fairly straight-forward to implement. Here are some of the key areas that can use improvement...

| Port glibc to LLVM

It would be very useful to port glibc to LLVM. This would allow a variety of interprocedural algorithms to be much more effective in the face of library calls. The most important pieces to port are things like the string library and the `stdio` related functions... low-level system calls like '`read`' should stay unimplemented in LLVM.

| Improving the Nightly Tester

The Nightly Tester is a simple perl script (located in utils/NightlyTest.pl) which runs every night to generate a daily report. It could use the following improvements:

1. Olden timings - Time the compilation and execution times for the Olden benchmark suite, keeping track of these values over time.
2. Graphs - It would be great to have gnuplot graphs to keep track of how the tree is changing over time. We already gather a several statistics, it just neccesary to add the script-fu to gnuplotize it.
3. Regression tests - We should run the regression tests in addition to the program tests...

| Compile programs with the LLVM Compiler

We are always looking for new testcases and benchmarks for use with LLVM. In particular, it is useful to try compiling your favorite C source code with LLVM. If it doesn't compile, try to figure out why or report it to the llvm-bugs list. If you get the program to compile, it would be extremely useful to convert the build system to be compatible with the LLVM Programs testsuite so that we can check it into CVS and the automated tester can use it to track progress of the compiler.

When testing a code, try running it with a variety of optimizations, and with all the back-ends: CBE, llc, and lli.

| Extend the LLVM intermediate representation

1. Transform `setjmp` and `longjmp` calls to use the LLVM `invoke` mechanism.
2. Add support for a volatile attribute on loads and stores
3. Support for variable argument functions
4. Add a new conditional move instruction: `X = select bool Cond, Y, Z`
5. Add support for platform independent prefetch support. The GCC prefetch project page has a good survey of the prefetching capabilities of a variety of modern processors.

| Miscellaneous Improvements

1. Someone needs to look into getting the `ranlib` tool to index LLVM bytecode files, so that linking in .a files is not hideously slow. They would also then have to implement the reader for this index in `gccld`.
2. Improve the efficiency of the bytecode loader/writer, allow streaming lazy loading of functions from the bytecode (for use by the JIT, for example)
3. Rework the PassManager to be more flexible
4. Some transformations and analyses only work on reducible flow graphs. It would be nice to have a transformation which could be "required" by these passes which makes irreducible graphs reducible. This can easily be accomplished through code duplication. See Making Graphs Reducible with Controlled Node Splitting and perhaps Nesting of Reducible and Irreducible Loops.

Adding new capabilities to LLVM

Sometimes creating new things is more fun that improving existing things. These projects tend to be more involved and perhaps require more work, but can also be very rewarding.

| Pointer and Alias Analysis

We have a strong base for development of both pointer analysis based optimizations as well as pointer analyses themselves. It seems natural to want to take advantage of this...

1. Implement a flow-sensitive context-sensitive alias analysis algorithm
   - Pick one of the somewhat efficient algorithms, but strive for maximum precision
2. Implement a flow-sensitive context-insensitive alias anlaysis algorithm
   - Just an efficient local algorithm perhaps?
3. Implement an interface to update analyses in response to common code motion transformations
4. Implement alias analysis based optimizations:
   - Dead store elimination
   - Store+Reload or "store forwarding" elimination:

     Change:

                 store int X, int* P
                 Y = load int* P

     into:

                 store int X, int *P
                 Y = X

| Profile Guided Optimization

We are getting to the point where we really need a unified infrastructure for profile guided optimizations. It would be wonderful to be able to write profile guided transformations which can be performed either at static compile time (compile time or offline optimization time) or at runtime in a JIT type setup. The LLVM transformation itself shouldn't need to know how it is being used.

Ideas for profile guided transformations:

1. Superblock formation (with many optimizations)
2. Loop unrolling/peeling
3. Profile directed inlining
4. Code layout
5. ...

| New Transformations and Analyses

1. Implement a Dependence Analysis Infrastructure
   - Design some way to represent and query dep analysis
2. Implement a faster Dominator Set Construction Algorithm
   - A linear time or nearly so algorithm
3. Implement a strength reduction pass
4. Value range propagation pass
5. Implement a tail recursion elimination pass
6. Implement an unswitching pass

| X86 Back-end Improvements

1. Implement a global register allocator
2. Implement a better instruction selector
3. Implement a static compiler in addition to the JIT (easy project)
4. Implement support for the "switch" instruction without requiring the lower-switches pass.

| Miscellaneous Additions

1. Write a new frontend for some language (Java? OCaml? Forth?)
2. Write a new backend for a target (IA64? MIPS? MMIX?)

Last modified: Tue May 6 15:46:48 CDT 2003