edA-qa mort-ora-y via llvm-dev
2018-May-05 22:19 UTC
[llvm-dev] Slow IR compilation/JIT, profiling points to LLVM?
On 05/05/18 17:58, Andres Freund wrote:> You're building LLVM with assertions enabled > (-DLLVM_ENABLE_ASSERTIONS=ON). > Some of those are fairly expensive... >Is there another way to get LLVM to check the correctness of my IR without the assertions? That's what I'm assuming I need the flag for (it's been a long time since I experimented with it) If there is no way I guess I'll have to produce two versions of LLVM. I still commonly get type errors in my LLVM IR. -- 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
Andres Freund via llvm-dev
2018-May-05 22:21 UTC
[llvm-dev] Slow IR compilation/JIT, profiling points to LLVM?
Hi, On 2018-05-06 00:19:42 +0200, edA-qa mort-ora-y wrote:> On 05/05/18 17:58, Andres Freund wrote: > > You're building LLVM with assertions enabled > > (-DLLVM_ENABLE_ASSERTIONS=ON). > > Some of those are fairly expensive... > > > > Is there another way to get LLVM to check the correctness of my IR > without the assertions? That's what I'm assuming I need the flag for > (it's been a long time since I experimented with it)I don't think so.> If there is no way I guess I'll have to produce two versions of LLVM. I > still commonly get type errors in my LLVM IR.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). Greetings, Andres Freund
edA-qa mort-ora-y via llvm-dev
2018-May-06 08:55 UTC
[llvm-dev] Slow IR compilation/JIT, profiling points to LLVM?
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. 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. -- 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