[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
> 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
> 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.
> Vesa Norilo
> Centre for Music and Technology
> University of Arts Helsinki
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
Department of Computer Science, University of Rochester
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev