On Thursday 09 August 2007 15:56, Devang Patel wrote:> On Aug 9, 2007, at 1:52 PM, David Greene wrote: > > So how do I get opt to use Andersens instead of basicaa, for example? > > Following uses basic alias analysis > > $ opt -licm foo.bc -disable-output -debug-pass=Structure > > where as > > $ opt -anders-aa -licm foo.bc -disable-output -debug-pass=Structure > > uses Andersens analysis algorithm implementation.Heh. opt was a particularly bad choice for an example on my part. It has special code to provide options for all of the optimizations: // The OptimizationList is automatically populated with registered Passes by // the PassNameParser. // static cl::list<const PassInfo*, bool, PassNameParser> PassList(cl::desc("Optimizations available:")); A better question to ask is, how do I do this with llvm-gcc? My perusal of the code doesn't turn up any obvious places for options for alias analysis are registered. -Dave
On Aug 9, 2007, at 2:22 PM, David Greene wrote:> A better question to ask is, how do I do this with llvm-gcc? My > perusal of > the code doesn't turn up any obvious places for options for alias > analysis > are registered.As you've figured out, not all options are exposed by llvm-gcc. You'll have to update llvm-gcc. - Devang
On Thursday 09 August 2007 16:29, Devang Patel wrote:> On Aug 9, 2007, at 2:22 PM, David Greene wrote: > > A better question to ask is, how do I do this with llvm-gcc? My > > perusal of > > the code doesn't turn up any obvious places for options for alias > > analysis > > are registered. > > As you've figured out, not all options are exposed by llvm-gcc. You'll > have to update llvm-gcc.So what's the right way to do this? There's the regalloc way, which invents a whole new class just to register register allocators and provide an option for picking one. But alias analysis already uses AnalysisGroup so a new class to register alias analysis passes isn't necessary. It seems desireable to augment AnalysisGroup with the ability to provide command-line options. Is this a good strategy or is there a better way? -Dave