summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lto/lto.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-09-15 23:05:59 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-09-15 23:05:59 +0000
commitcff5feff6fd6e18e73b97de41f9aa5da23ceee95 (patch)
tree33ceb04978a9c105fba18d6d4a3b9056c0f91330 /llvm/tools/lto/lto.cpp
parentc1603b64937c90f6b4515fe84f5f3c8779b56925 (diff)
downloadbcm5719-llvm-cff5feff6fd6e18e73b97de41f9aa5da23ceee95.tar.gz
bcm5719-llvm-cff5feff6fd6e18e73b97de41f9aa5da23ceee95.zip
Reapply "LTO: Disable extra verify runs in release builds"
This reverts commit r247730, effectively reapplying r247729. This time I have an lld commit ready to follow. llvm-svn: 247735
Diffstat (limited to 'llvm/tools/lto/lto.cpp')
-rw-r--r--llvm/tools/lto/lto.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp
index 8f62929b326..62675081464 100644
--- a/llvm/tools/lto/lto.cpp
+++ b/llvm/tools/lto/lto.cpp
@@ -43,6 +43,16 @@ static cl::opt<bool>
DisableLTOVectorization("disable-lto-vectorization", cl::init(false),
cl::desc("Do not run loop or slp vectorization during LTO"));
+#ifdef NDEBUG
+static bool VerifyByDefault = false;
+#else
+static bool VerifyByDefault = true;
+#endif
+
+static cl::opt<bool> DisableVerify(
+ "disable-llvm-verifier", cl::init(!VerifyByDefault),
+ cl::desc("Don't run the LLVM verifier during the optimization pipeline"));
+
// Holds most recent error string.
// *** Not thread safe ***
static std::string sLastErrorString;
@@ -321,8 +331,9 @@ bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) {
const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) {
maybeParseOptions(cg);
LibLTOCodeGenerator *CG = unwrap(cg);
- CG->NativeObjectFile = CG->compile(DisableInline, DisableGVNLoadPRE,
- DisableLTOVectorization, sLastErrorString);
+ CG->NativeObjectFile =
+ CG->compile(DisableVerify, DisableInline, DisableGVNLoadPRE,
+ DisableLTOVectorization, sLastErrorString);
if (!CG->NativeObjectFile)
return nullptr;
*length = CG->NativeObjectFile->getBufferSize();
@@ -331,9 +342,8 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) {
bool lto_codegen_optimize(lto_code_gen_t cg) {
maybeParseOptions(cg);
- return !unwrap(cg)->optimize(DisableInline,
- DisableGVNLoadPRE, DisableLTOVectorization,
- sLastErrorString);
+ return !unwrap(cg)->optimize(DisableVerify, DisableInline, DisableGVNLoadPRE,
+ DisableLTOVectorization, sLastErrorString);
}
const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) {
@@ -349,7 +359,7 @@ const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) {
bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {
maybeParseOptions(cg);
return !unwrap(cg)->compile_to_file(
- name, DisableInline, DisableGVNLoadPRE,
+ name, DisableVerify, DisableInline, DisableGVNLoadPRE,
DisableLTOVectorization, sLastErrorString);
}
OpenPOWER on IntegriCloud