[llvm-dev] Metadata and compile time performance

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 19 05:54:30 PST 2016

On 2/19/16 7:47 AM, Norilo Vesa-Petri via llvm-dev wrote:
> Dear LLVMers,
> I’m investigating the response time of my JIT, and according to 
> profiling, optimization takes 85% of the compile time, while the rest 
> is being split evenly between the front-end and machine code 
> generation. Much of the optimizer time is spent in various alias 
> analysis passes.

One thing you might want to do is look at the pass pipeline and see if 
the alias analysis passes are being re-run multiple times.  If they are, 
then maybe the issue is getting alias analysis to run fewer times 
instead of trying to get it to run faster.

There could be two culprits for running analysis passes over and over 
again.  First, it's possible that an analysis pass (or passes) are 
invalidated over and over again by optimizations.  Changing the ordering 
of the optimizations or having key optimizations update the analysis 
information might fix that problem.

Second, unless it's been changed, using a FunctionPass from within a 
ModulePass forces the FunctionPass to be re-run from scratch whenever 
the getAnalysisUsage<FunctionPass>() method is called.  A poorly written 
ModulePass may cause a FunctionPass to be run over and over again 
needlessly.  I doubt that the in-tree optimizations make this sort of 
mistake, but it is conceivably possible.

To be clear, I don't know that this is the cause of your overhead, but 
if it were me, I'd check this first before trying to make alias analysis 
run faster.


John Criswell

> I’m happy with the generated code quality and wouldn’t like to lower 
> the optimization level (O2).
> Would generating alias metadata from the front-end help and speed up 
> optimization?
> If so, what kind of AA would have the best return on investment in 
> terms of compile time? TBAA is not applicable to my language, but I 
> could provide C99 restrict and related semantics fairly easily.
> Thanks!!
> Vesa Norilo
> Lecturer
> Centre for Music and Technology
> University of Arts Helsinki
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

John Criswell
Assistant Professor
Department of Computer Science, University of Rochester

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160219/1f830c50/attachment.html>

More information about the llvm-dev mailing list