Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lld/MachO/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ struct Configuration {
llvm::StringRef csProfilePath;
bool pgoWarnMismatch;
bool warnThinArchiveMissingMembers;
bool disableVerify;

bool callGraphProfileSort = false;
llvm::StringRef printSymbolOrder;
Expand Down
1 change: 1 addition & 0 deletions lld/MachO/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,7 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
args.hasFlag(OPT_warn_thin_archive_missing_members,
OPT_no_warn_thin_archive_missing_members, true);
config->generateUuid = !args.hasArg(OPT_no_uuid);
config->disableVerify = args.hasArg(OPT_disable_verify);

auto IncompatWithCGSort = [&](StringRef firstArgStr) {
// Throw an error only if --call-graph-profile-sort is explicitly specified
Expand Down
1 change: 1 addition & 0 deletions lld/MachO/LTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static lto::Config createConfig() {
c.CSIRProfile = std::string(config->csProfilePath);
c.RunCSIRInstr = config->csProfileGenerate;
c.PGOWarnMismatch = config->pgoWarnMismatch;
c.DisableVerify = config->disableVerify;
c.OptLevel = config->ltoo;
c.CGOptLevel = config->ltoCgo;
if (config->saveTemps)
Expand Down
3 changes: 3 additions & 0 deletions lld/MachO/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
def cs_profile_path: Joined<["--"], "cs-profile-path=">,
HelpText<"Context sensitive profile file path">, Group<grp_lld>;
def disable_verify : Flag<["--"], "disable_verify">,
HelpText<"Do not verify LLVM modules">,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit : would be good to move this flag around other LTO-specific flags. Ex: lto_CGO.
Also maybe help text could show this is LTO related. Ex "Do not verify LLVM modules during LTO"

Group<grp_lld>;
defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
"turn on warnings about profile cfg mismatch (default)",
"turn off warnings about profile cfg mismatch">, Group<grp_lld>;
Expand Down
16 changes: 16 additions & 0 deletions lld/test/MachO/verify.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; REQUIRES: x86

; RUN: llvm-as %s -o %t.o
; RUN: %lld -dylib %t.o -o %t2 --lto-debug-pass-manager 2>&1 | FileCheck %s --check-prefix=VERIFY
; RUN: %lld -dylib %t.o -o %t2 --lto-debug-pass-manager --disable_verify 2>&1 | FileCheck %s --implicit-check-not=VerifierPass

target triple = "x86_64-apple-darwin"
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

define void @_start() {
entry:
ret void
}

; VERIFY: Running pass: VerifierPass
; VERIFY: Running pass: VerifierPass
Loading