[llvm-dev] Optimizer takes very long

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Optimizer takes very long

Finkel, Hal J. via llvm-dev
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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Optimizer takes very long

Finkel, Hal J. via llvm-dev
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
<[hidden email]> 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
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev