[LLVMdev] Status of LLVM-MC

Chris Lattner clattner at apple.com
Sat Mar 6 11:27:29 PST 2010


On Mar 5, 2010, at 3:20 PM, Wayne Anderson wrote:

> Hello,
> 
> I'm interested in the status of LLVM-MC.  My particular interest is in  
> generating executables for ARM embedded applications.   I assume this  
> application is not terribly high on the priority list, so I would like  
> to know how I can contribute.  Can someone point me to some  
> information and/or docs on the project and its status.   Also, if  
> someone could give me an example of how to invoke the tool for any  
> currently working target; that would be a helpful start.

Hi Wayne,

There are a couple of different places to start.  Daniel and I have been focused on darwin/x86[-64] to start with, but bringing up support for other targets would be great.  The first piece of work is to get the code generator to emit everything through the MCStreamer interface instead of textually to the raw_ostream.

For X86, we're to the point where this is done except for debug info, exception info, and inline asm.  I plan to tackle the former two over the next couple weeks.

For ARM, the ARM backend has completely migrated yet.  The first major step is to get the ARM backend emitting instructions by lowering them to MCInst's then pushing the MCInst through the AsmStreamer interface.  This allows the encoder to handle them, or (if actually emitting a .s file) the ARMInstPrinter to print out the instruction. I started this process, but haven't finished it and it isn't a very high priority for me.

To see what is being emitted textually, you can do something like this:

$ llc foo.bc -o - -filetype=null -march=arm

This will cause everything emitted to the MCStreamer to be discarded, and print everything done textually to stdout.  For ARM it looks like this includes all the instructions, as well as PIC stubs on darwin.

In summary, the first step I'd suggest is to get the -enable-arm-mcinst-printer option (which enables printing through mcinsts) to work fully.

-Chris



More information about the llvm-dev mailing list