Skip to content

Commit 71ca9fc

Browse files
authored
llvm-reduce: Don't print verifier failed machine functions (llvm#109673)
This produces far too much terminal output, particularly for the instruction reduction. Since it doesn't consider the liveness of of the instructions it's deleting, it produces quite a lot of verifier errors.
1 parent 6d3d5f3 commit 71ca9fc

File tree

9 files changed

+159
-130
lines changed

9 files changed

+159
-130
lines changed

llvm/include/llvm/CodeGen/MachineFunction.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -897,13 +897,14 @@ class LLVM_ABI MachineFunction {
897897
/// for debugger use.
898898
/// \returns true if no problems were found.
899899
bool verify(Pass *p = nullptr, const char *Banner = nullptr,
900-
bool AbortOnError = true) const;
900+
raw_ostream *OS = nullptr, bool AbortOnError = true) const;
901901

902902
/// Run the current MachineFunction through the machine code verifier, useful
903903
/// for debugger use.
904904
/// \returns true if no problems were found.
905905
bool verify(LiveIntervals *LiveInts, SlotIndexes *Indexes,
906-
const char *Banner = nullptr, bool AbortOnError = true) const;
906+
const char *Banner = nullptr, raw_ostream *OS = nullptr,
907+
bool AbortOnError = true) const;
907908

908909
// Provide accessors for the MachineBasicBlock list...
909910
using iterator = BasicBlockListType::iterator;

llvm/lib/CodeGen/MIRParser/MIRParser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF,
634634

635635
MF.getSubtarget().mirFileLoaded(MF);
636636

637-
MF.verify();
637+
MF.verify(nullptr, nullptr, &errs());
638638
return false;
639639
}
640640

llvm/lib/CodeGen/MachineBlockPlacement.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3698,7 +3698,7 @@ void MachineBlockPlacement::assignBlockOrder(
36983698

36993699
#ifndef NDEBUG
37003700
// Make sure we correctly constructed all branches.
3701-
F->verify(this, "After optimized block reordering");
3701+
F->verify(this, "After optimized block reordering", &errs());
37023702
#endif
37033703
}
37043704

llvm/lib/CodeGen/MachineScheduler.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ bool MachineScheduler::runOnMachineFunction(MachineFunction &mf) {
453453

454454
if (VerifyScheduling) {
455455
LLVM_DEBUG(LIS->dump());
456-
MF->verify(this, "Before machine scheduling.");
456+
MF->verify(this, "Before machine scheduling.", &errs());
457457
}
458458
RegClassInfo->runOnMachineFunction(*MF);
459459

@@ -472,7 +472,7 @@ bool MachineScheduler::runOnMachineFunction(MachineFunction &mf) {
472472

473473
LLVM_DEBUG(LIS->dump());
474474
if (VerifyScheduling)
475-
MF->verify(this, "After machine scheduling.");
475+
MF->verify(this, "After machine scheduling.", &errs());
476476
return true;
477477
}
478478

@@ -496,7 +496,7 @@ bool PostMachineScheduler::runOnMachineFunction(MachineFunction &mf) {
496496
AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
497497

498498
if (VerifyScheduling)
499-
MF->verify(this, "Before post machine scheduling.");
499+
MF->verify(this, "Before post machine scheduling.", &errs());
500500

501501
// Instantiate the selected scheduler for this target, function, and
502502
// optimization level.
@@ -512,7 +512,7 @@ bool PostMachineScheduler::runOnMachineFunction(MachineFunction &mf) {
512512
scheduleRegions(*Scheduler, true);
513513

514514
if (VerifyScheduling)
515-
MF->verify(this, "After post machine scheduling.");
515+
MF->verify(this, "After post machine scheduling.", &errs());
516516
return true;
517517
}
518518

0 commit comments

Comments
 (0)