LLVM runs much more quickly when it’s optimized and assertions are removed.
However, such a build is currently incompatible with users who build without
defining NDEBUG, and the lack of assertions makes it hard to debug problems
in user code. We recommend allowing users to install both optimized and debug
versions of LLVM in parallel. The following configure flags are relevant:

--disable-assertions

Builds LLVM with NDEBUG defined. Changes the LLVM ABI. Also available
by setting DISABLE_ASSERTIONS=0|1 in make‘s environment. This
defaults to enabled regardless of the optimization setting, but it slows
things down.

--enable-debug-symbols

Builds LLVM with -g. Also available by setting DEBUG_SYMBOLS=0|1 in
make‘s environment. This defaults to disabled when optimizing, so you
should turn it back on to let users debug their programs.

--enable-optimized

(For svn checkouts) Builds LLVM with -O2 and, by default, turns off
debug symbols. Also available by setting ENABLE_OPTIMIZED=0|1 in
make‘s environment. This defaults to enabled when not in a
checkout.