[llvm-dev] Optimizer takes very long

Eric Christopher via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 10 10:39:12 PDT 2019


First I'd double check that you're using an optimized binaries with
asserts turned off.

You can also use -time-passes in opt to take a look at how long
certain optimizations are taking.

-eric

On Wed, Apr 10, 2019 at 6:56 AM Ephrim Khong via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Dear All,
>
> we are building a JIT compiler that uses LLVM as backend and are
> running into issues with the compilation time. In the worst case,
> compiling (i.e. optimizing and producing bytecode) a function with ~3k
> lines takes up to 8-10 minutes. Note that we are not very concerned
> with the actual performance of the JIT compiled code - anything binary
> will be massively faster than what we have.
>
> I am unsure how to proceed and what the issue might be. I found the
> Performance Tips [1] and noticed that one of our building blocks has
> almost 1000 predecessors, something that is disencouraged. Could that
> be a problem? It's the result of a very long if-elseif-chain, where
> all "else" branches branch to the first basic block after that
> if-elseif chain.
>
> Not adding any runs and setting OptLevel=0 already improves the
> compilation time by a factor of 10 (from ~510 seconds to ~50 seconds).
> Are there any other ways of debugging or inspecting what the cause
> might be?
>
> Thanks
> - Eph
>
> [1] https://llvm.org/docs/Frontend/PerformanceTips.html
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list