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