Skip to content

Commit

Permalink
[opt] Do not add verify pass at beginning of pipeline
Browse files Browse the repository at this point in the history
We've already verified the input module manually in opt so this is redundant.

Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D139899
  • Loading branch information
aeubanks committed Dec 13, 2022
1 parent 0cd3097 commit ef28a87
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 24 deletions.
2 changes: 0 additions & 2 deletions llvm/test/Other/ChangePrinters/print-changed-diff.ll
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ entry:

; CHECK-DIFF-SIMPLE: *** IR Dump At Start ***
; CHECK-DIFF-SIMPLE: ModuleID = {{.+}}
; CHECK-DIFF-SIMPLE: *** IR Dump After VerifierPass on [module] omitted because no change ***
; CHECK-DIFF-SIMPLE: *** IR Dump After InstSimplifyPass on g ***
; CHECK-DIFF-SIMPLE-NOT: ModuleID = {{.+}}
; CHECK-DIFF-SIMPLE-NOT: *** IR{{.*}}
Expand Down Expand Up @@ -353,7 +352,6 @@ entry:

; CHECK-CDIFF-SIMPLE: *** IR Dump At Start ***
; CHECK-CDIFF-SIMPLE: ModuleID = {{.+}}
; CHECK-CDIFF-SIMPLE: *** IR Dump After VerifierPass on [module] omitted because no change ***
; CHECK-CDIFF-SIMPLE: *** IR Dump After InstSimplifyPass on g ***
; CHECK-CDIFF-SIMPLE-NOT: ModuleID = {{.+}}
; CHECK-CDIFF-SIMPLE-NOT: *** IR{{.*}}
Expand Down
2 changes: 0 additions & 2 deletions llvm/test/Other/change-printer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ entry:

; CHECK-SIMPLE: *** IR Dump At Start ***
; CHECK-SIMPLE-NEXT: ; ModuleID = {{.+}}
; CHECK-SIMPLE: *** IR Dump After VerifierPass on [module] omitted because no change ***
; CHECK-SIMPLE: *** IR Dump After InstSimplifyPass on g ***
; CHECK-SIMPLE-NEXT: define i32 @g()
; CHECK-SIMPLE: *** IR Pass PassManager{{.*}} on g ignored ***
Expand Down Expand Up @@ -189,7 +188,6 @@ entry:

; CHECK-SIMPLE-BEFORE: *** IR Dump At Start ***
; CHECK-SIMPLE-BEFORE-NEXT: ; ModuleID = {{.+}}
; CHECK-SIMPLE-BEFORE: *** IR Dump After VerifierPass on [module] omitted because no change ***
; CHECK-SIMPLE-BEFORE: *** IR Dump Before InstSimplifyPass on g ***
; CHECK-SIMPLE-BEFORE-NEXT: define i32 @g()
; CHECK-SIMPLE-BEFORE: *** IR Dump After InstSimplifyPass on g ***
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Other/new-pass-manager-verify-each.ll
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,verify,cgscc(no-op-cgscc,function(no-op-function,loop(no-op-loop)))' %s 2>&1 | FileCheck %s

; Added manually by opt at beginning
; CHECK: Running pass: VerifierPass
; opt already manually verifies input IR
; CHECK-NOT: Running pass: VerifierPass

; CHECK: Running pass: NoOpModulePass
; CHECK: Verifying module
Expand Down
3 changes: 0 additions & 3 deletions llvm/test/Other/new-pass-manager.ll
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PRINT
; CHECK-MODULE-PRINT: Running pass: VerifierPass
; CHECK-MODULE-PRINT: Running pass: PrintModulePass
; CHECK-MODULE-PRINT: ModuleID
; CHECK-MODULE-PRINT: define void @foo(i1 %x, ptr %p1, ptr %p2)
Expand All @@ -54,7 +53,6 @@

; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
; CHECK-FUNCTION-PRINT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
; CHECK-FUNCTION-PRINT: Running pass: PrintFunctionPass
; CHECK-FUNCTION-PRINT-NOT: ModuleID
Expand Down Expand Up @@ -93,7 +91,6 @@
; CHECK-NO-VERIFY-NOT: VerifierPass
; CHECK-NO-VERIFY: Running pass: NoOpFunctionPass
; CHECK-NO-VERIFY-NOT: VerifierPass
; CHECK-NO-VERIFY-NOT: VerifierPass

; RUN: opt -disable-output -debug-pass-manager \
; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
Expand Down
8 changes: 2 additions & 6 deletions llvm/test/Other/opt-bisect-new-pass-manager.ll
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@
; RUN: opt -disable-output -debug-pass-manager \
; RUN: -passes=inferattrs -opt-bisect-limit=-1 %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-REQUIRED-PASS
; CHECK-REQUIRED-PASS-NOT: BISECT: {{.*}} VerifierPass
; CHECK-REQUIRED-PASS: Running pass: VerifierPass
; CHECK-REQUIRED-PASS: BISECT: running pass (1) InferFunctionAttrsPass on [module]
; CHECK-REQUIRED-PASS-NOT: BISECT: {{.*}} VerifierPass
; CHECK-REQUIRED-PASS-NOT: BISECT: {{.*}}VerifierPass
; CHECK-REQUIRED-PASS: Running pass: VerifierPass

; RUN: opt -disable-output -debug-pass-manager \
; RUN: -passes=inferattrs -opt-bisect-limit=0 %s 2>&1 \
; RUN: | FileCheck %s --check-prefix=CHECK-LIMIT-REQUIRED-PASS
; CHECK-LIMIT-REQUIRED-PASS-NOT: BISECT: {{.*}} VerifierPass
; CHECK-LIMIT-REQUIRED-PASS: Running pass: VerifierPass
; CHECK-LIMIT-REQUIRED-PASS: BISECT: NOT running pass (1) InferFunctionAttrsPass on [module]
; CHECK-LIMIT-REQUIRED-PASS-NOT: BISECT: {{.*}} VerifierPass
; CHECK-LIMIT-REQUIRED-PASS-NOT: BISECT: {{.*}}VerifierPass
; CHECK-LIMIT-REQUIRED-PASS: Running pass: VerifierPass

; RUN: opt -disable-output -disable-verify \
Expand Down
1 change: 0 additions & 1 deletion llvm/test/Other/printer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ define void @foo(){
ret void
}

; CHECK: *** IR Dump After VerifierPass
; CHECK: *** IR Dump After PromotePass
; CHECK-NEXT: define void @tester
; CHECK: *** IR Dump After InstCombinePass
Expand Down
2 changes: 0 additions & 2 deletions llvm/tools/opt/NewPMDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,6 @@ bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);

ModulePassManager MPM;
if (VK > VK_NoVerifier)
MPM.addPass(VerifierPass());
if (EnableDebugify)
MPM.addPass(NewPMDebugifyPass());
if (VerifyDIPreserve)
Expand Down
6 changes: 1 addition & 5 deletions llvm/tools/opt/NewPMDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ enum OutputKind {
OK_OutputBitcode,
OK_OutputThinLTOBitcode,
};
enum VerifierKind {
VK_NoVerifier,
VK_VerifyInAndOut,
VK_VerifyEachPass
};
enum VerifierKind { VK_NoVerifier, VK_VerifyOut, VK_VerifyEachPass };
enum PGOKind {
NoPGO,
InstrGen,
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/opt/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ int main(int argc, char **argv) {
? OK_OutputAssembly
: (OutputThinLTOBC ? OK_OutputThinLTOBitcode : OK_OutputBitcode);

VerifierKind VK = VK_VerifyInAndOut;
VerifierKind VK = VK_VerifyOut;
if (NoVerify)
VK = VK_NoVerifier;
else if (VerifyEach)
Expand Down

0 comments on commit ef28a87

Please sign in to comment.