LTO: Disable extra verify runs in release builds
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 15 Sep 2015 22:26:11 +0000 (22:26 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 15 Sep 2015 22:26:11 +0000 (22:26 +0000)
commitb0d872aecec7dc6ed85aa588e753389afd001390
tree55463cf3df272286846613837fa7b9a5de428cbd
parent7bfd1e910683f0c075a6fa5a32173e76bb0d83da
LTO: Disable extra verify runs in release builds

The verifier currently runs three times in LTO: (1) after parsing, (2)
at the beginning of the optimization pipeline, and (3) at the end of it.

The first run is important, since we're not sure where the bitcode comes
from and it's nice to validate it, but in release builds the extra runs
aren't appropriate.

This commit:
  - Allows these runs to be disabled in LTOCodeGenerator.
  - Adds command-line options to llvm-lto.
  - Adds command-line options to libLTO.dylib, and disables the verifier
    by default in release builds (based on NDEBUG).

This shaves about 3.5% off the runtime of ld64 when linking
verify-uselistorder with -flto -g.

rdar://22509081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247729 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/LTOCodeGenerator.h
lib/LTO/LTOCodeGenerator.cpp
test/LTO/X86/disable-verify.ll [new file with mode: 0644]
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp