[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)

Rob Pieke rob-p at moving-picture.com
Mon Nov 15 08:42:55 PST 2010


SUCCESS!

Sorry, I had removed the addFnAttr() call by accident. Using the basicAA pass and ReadOnly, as you suggested, works like a charm!

:)



> -----Original Message-----
> From: Rob Pieke
> Sent: Monday, November 15, 2010 4:40 PM
> To: 'Duncan Sands'
> Cc: 'llvmdev at cs.uiuc.edu'; 'Dan Gohman'
> Subject: RE: [LLVMdev] Optimization of calls to functions without side
> effects (from Kaleidoscope example)
> 
> Still no luck after switching to:
> 
> 	theFPM->add( new llvm::TargetData( *theExecutionEngine-
> >getTargetData() ) );
> 	theFPM->add( llvm::createBasicAliasAnalysisPass() );
> 	theFPM->add( llvm::createInstructionCombiningPass() );
> 	theFPM->add( llvm::createReassociatePass() );
> 	theFPM->add( llvm::createGVNPass() );
> 	theFPM->add( llvm::createCFGSimplificationPass() );
> 
> Based on output from "llvm-ld -version" and "clang -v" I'm using:
> 
>   llvm version 2.9svn
>   clang version 2.9 (trunk 118171)
> 
> 
> 
> > -----Original Message-----
> > From: Duncan Sands [mailto:baldrick at free.fr]
> > Sent: Monday, November 15, 2010 4:32 PM
> > To: Rob Pieke
> > Cc: llvmdev at cs.uiuc.edu; Dan Gohman
> > Subject: Re: [LLVMdev] Optimization of calls to functions without
> side
> > effects (from Kaleidoscope example)
> >
> > Hi Rob,
> >
> > > I'm using the gvn pass, not sure about basic-aa.
> >
> > if you are using LLVM from svn then you need to specify the basic-aa
> > analysis,
> > otherwise gvn won't unify calls to readonly/readnone functions.  This
> > is new
> > behaviour introduced by Dan; probably the tutorial should be updated.
> >
> > Ciao,
> >
> > Duncan.





More information about the llvm-dev mailing list