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

Andres Freund via llvm-dev llvm-dev at lists.llvm.org
Sat May 5 08:58:31 PDT 2018


Hi,

On 2018-05-05 08:04:54 +0200, edA-qa mort-ora-y via llvm-dev 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

> 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"

You're building LLVM with assertions enabled (-DLLVM_ENABLE_ASSERTIONS=ON).
Some of those are fairly expensive...

- Andres


More information about the llvm-dev mailing list