[llvm-dev] Slow IR compilation/JIT, profiling points to LLVM?

Andres Freund via llvm-dev llvm-dev at lists.llvm.org
Sun May 6 15:21:23 PDT 2018


Hi,

On 2018-05-06 10:55:49 +0200, edA-qa mort-ora-y wrote:
> On 06/05/18 00:21, Andres Freund wrote:
> > That's what I do (using Orc to JIT parts of SQL queries). By default I
> > have the debug build of postgres linked against debug LLVM w/
> > assertions, and the optimized build against an optimized LLVM wo/
> > assertions (albeit with symbols).

> I've tried a builld with assertions off and it has only a relatively
> minor impact (a 10% drop in time spent in LLVM). The instruction cound
> for `findAnalysisPass` is gone, but the things like `AddInteger` are
> still called millions of times.

The findAnalysisPass symbols in the profile where what made me think of
assertions, because I frequently see them at the top when using LLVM w/
assertions.


> Given the number of IR instructions (at most 65K since a 65K IR file),
> the millions of calls to the Add, and FindBucket functions seems wrong.

I suggest posting an example IR file, so others can look at why things
are slow. Without a reproducer that's going to be hard.

Have you looked at tweaking the optimization pipeline / checking which
parts of the pipeline are slow? You can use something like:

opt -O3 -time-passes -o /dev/null /path/to/bitcode/file.bc

Greetings,

Andres Freund


More information about the llvm-dev mailing list