[LLVMdev] Back ends for instructional use?

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Aug 15 15:35:47 PDT 2011


On Aug 15, 2011, at 11:20 AM, Adve, Vikram Sadanand wrote:

> I'm trying to decide whether to use either the MIPS or ARM back ends for course projects in our introductory compiler class.  I'd like to use something that has a stable back end, so that the students can use the selector, probably without changes, and do a project on register allocation and stack layout.  We don't have MIPS or ARM hardware (other than possibly a few donated Android phones to play with), so a simulator like Spim will be essential.

You should also consider that the ARM architecture offers more interesting problems for stack layout and register allocation than Mips does:

- There are multiple different ARM load/store instructions with differing maximum stack pointer offsets, while Mips is very regular.

- The ARM backend can create extra virtual base registers for stack regions that are out of reach for normal load/store instructions. Mips will simply use the AT register for offsets larger than 16 bits.

- The ARM NEON register bank has interesting aliases and register classes. It doesn't really make sense to talk about a K-coloring of the interference graph, or even modeling register pressure as a single number.

There are some research projects in there:

- Cluster stack objects in a way that minimizes the number of live virtual base registers at the hot spots in the code.

- Accurately model register pressure for overlapping register classes and complicated aliasing.

/jakob




More information about the llvm-dev mailing list