[LLVMdev] Choosing Alias Analysis

Chris Lattner sabre at nondot.org
Thu Aug 9 17:21:10 PDT 2007


On Thu, 9 Aug 2007, David Greene wrote:
>> intentionally does not publish all of the llvm options through cc1.  We
>> can add new options, but that has to be an explicit design decision.  We
>> do allow you to use some options through -mllvm -foo, but that won't help
>> in this case.

> Alias analysis is just the closest example of what I really need to do:
> provide an option to choose a coalescer.  I've got a scheme where
> coalescers register with an AnalysisGroup (just like AA) and I need a
> way to pick one at runtime.  This really has nothing to do with llvm-gcc.
> It's a question of how to provide command-line options for choosing
> members of an AnalysisGroup where the trick used by opt is not available
> (because one doesn't want to expose all of the passes as options).

Ah, I see ok.  This is different then. :)

We don't want the users of the *c compiler* to be able to choose different 
coallescers.  Having selectable coallescers is useful for two communities: 
1) people hacking on the compiler 2) people building other tools with 
other constraints.

As far as the C compiler goes, we want to have just one option that works 
well, we don't want a million knobs people have to tweak.

We already service #2 through various means, so you really want to help 
out #1.  This is exactly what the -mllvm option is for: to pass random 
stuff down into the llvm command line option stuff without exposing it to 
the users through a sanctioned option.

> My question is whether AnalysisGroup should provide a mechanism to
> register command-line options.  Then one could pick an alias analysis
> with, for example, -alias=andersens.  Or -coalscer=aggressive.  Or even
> -regalloc=linearscan if register allocation were recoded to use AnalysisGroup.

Interesting question, I don't have an answer to this.  To make things more 
complicated, you can have multiple instances of an analysis group and may 
want different things at different times:

   -basicaa -licm -something_that_invalidates_aa -andersaa -licm -whatever

In the short term, adding a cl::opt to llvm-backend.cpp seems the easiest 
way to go, which makes it available through -mllvm.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list