[LLVMdev] Making a pass available to llc?

Michael McCracken michael.mccracken at gmail.com
Tue Jul 26 17:25:43 PDT 2005


On 7/25/05, Reid Spencer <reid at x10sys.com> wrote:
> On Mon, 2005-07-25 at 21:48 -0700, Michael McCracken wrote:
> > On 7/25/05, Reid Spencer <reid at x10sys.com> wrote:
> > > Why not just create your pass as a shared object and:
> > >
> > > opt -load mypass.so -mypass | llc
> >
> > My pass is an implementation of an analysis group that I wanted to
> > make available to machine passes as well as optimization passes. So I
> > really do want it in llc, not just its output.
> >
> > I could easily change my llc to just load my pass, I just wanted to
> > check if there was a better way first.
> 
> That sounds like the simplest thing to do. Loadable analyses in llc
> would be a good feature to add if you wanted to contribute that back.
> That way any machine level analyses that are needed could be loaded
> (presumably via llvmc).

OK, I have a version of llc that creates passes which are registered
as PassInfo::LLC.
It's essentially a clone of the code in opt and analyze.

Since I'm modifying llc, I have a couple small questions about that code:

opt and analyze (and a couple of other places) add a verifier pass,
but llc doesn't.
This would seem to make sense for llc as well - should I add it, with
the corresponding
hidden -no-verify option?

> > Specifically, should I dive
> > into llvmc and help flush out bugs? (how unfinished is it?)
> 
> Its not so much buggy as it is incomplete. It will faithfully compile
> programs per the language configuration files using whatever tools are
> required for a given language. See the configuration files in
> llvm/tools/llvmc directory for examples. The main thing that is lacking
> is not so much llvmc as it is llvm-ld which currently can't produce
> native executables well. This may not matter for your project. There's
> probably a few other things wrong with it but I forget the details. To
> see it in action, check out the samples directory in the Stacker
> project. It currently uses llvmc to compile the sample programs. Same
> goes for the test directory.

OK, sounds like the solution to my problem is to modify llc, and is
sort of unrelated to llvmc, so I'll stick with what I was doing.

Thanks,
-mike

-- 
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/blog/




More information about the llvm-dev mailing list