Skip to content

Commit 5b3e152

Browse files
authored
llvm-reduce: Make run-ir-passes error more consistent (#133564)
Avoid capitalized Error. This loses the "Error constructing pass pipeline" part, and just forwards the error to the default report_fatal_error case. Not sure if it's worth trying to keep.
1 parent e87bec6 commit 5b3e152

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; RUN: not llvm-reduce --abort-on-invalid-reduction --delta-passes=ir-passes --ir-passes=does-not-parse --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
2+
3+
; CHECK-INTERESTINGNESS-LABEL: @f1
4+
; ERR: LLVM ERROR: unknown pass name 'does-not-parse'
5+
6+
define i32 @f1(i32 %a) {
7+
%b = add i32 %a, 5
8+
%c = add i32 %b, 5
9+
ret i32 %c
10+
}
11+
12+
define i32 @f2(i32 %a) {
13+
%b = add i32 %a, 5
14+
%c = add i32 %b, 5
15+
ret i32 %c
16+
}
17+
18+
declare void @f3()

llvm/tools/llvm-reduce/deltas/RunIRPasses.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ static void runPasses(Oracle &O, ReducerWorkItem &WorkItem) {
4343
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
4444

4545
ModulePassManager MPM;
46-
if (auto Err = PB.parsePassPipeline(MPM, PassPipeline)) {
47-
errs() << toString(std::move(Err)) << "\n";
48-
report_fatal_error("Error constructing pass pipeline");
49-
}
46+
if (auto Err = PB.parsePassPipeline(MPM, PassPipeline))
47+
report_fatal_error(std::move(Err), false);
5048
MPM.run(Program, MAM);
5149
}
5250

0 commit comments

Comments
 (0)