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

Alex Denisov via llvm-dev llvm-dev at lists.llvm.org
Sat May 5 00:51:29 PDT 2018


Hi,

Could you share how you compile IR and which version of JIT you use (Orc, MCJIT)?
Could it be that you are using interpreter instead of actual JIT?

Cheers,
Alex.

> On 5. May 2018, at 08:04, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I'm having issues of my compiler, and JIT execution, of LLVM IR being
> rather slow. It's accounting for the vast majority of my full
> compilation time.  I'm trying to figure out why this is happening, since
> it's becoming an impediment.  (Note: by slow I mean about 3s of time for
> only about 2K of my front-end code, 65K lines of LLVM-IR)
> 
> 
> Using valgrind I see some functions which seem out of place and
> accounting for the vast majority of the time.
> 
>     5.72%; 635,008 Calls; llvm::PMTopLevelManager::findAnalysisPass(void
> const*) <cycle 4>
> 
>     4.54%; 3,722,489 Calls; llvm::PMDataManager::findAnalysisPass(void
> const*, bool)'2
> 
>     4.11%; 4,604,499 Calls; bool
> llvm::DenseMapBase<>::LookupBucketFor<>(void const* const&,
> llvm::detail::DenseMapPair<> const*&) const
> 
> Also of interest, given the high call count:
> 
>     1.32%; 6,915,882 Calls; llvm::FoldingSetNodeID::AddInteger(unsigned
> int) <cycle 4>
> 
> The call counts seem quite high given the size of the code. Also, the
> `findAnalysisPass` function just seems off, but I don't understand
> LLVM's architecture to be sure.
> 
> 
> Could this be pointing to something I'm doing wrong in my LLVM setup, or
> is it just slow?
> 
> 
> I'm reasonably certain I'm compiling LLVM in optimized mode, but for
> reference, this is my build line:
> 
>     cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_EH=ON
> -DLLVM_ENABLE_RTTI=ON -DLLVM_REQUIRES_RTTI=ON -DLLVM_ENABLE_CXX1Y=ON
> -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_FFI=ON
> -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON
> -DCMAKE_INSTALL_PREFIX="/opt/llvm/install"
> 
> 
> The overall time split, from valgrind, between shared libraries in my
> code is:
> 
>     80.48%, libLLVM-6.0.so
>     8.83% libc-2.23.so
>     2.34% libleaf_lang.so (my front-end)
> 
> --
> edA-qa mort-ora-y
> 	http://mortoray.com/
> 
> Creator of the Leaf language
> 	http://leaflang.org/
> 
> Streaming algorithms, AI, and design on Twitch
> 	https://www.twitch.tv/mortoray
> 
> Twitter
> 	edaqa
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180505/b4c08aeb/attachment.sig>


More information about the llvm-dev mailing list