Skip to content

[MachineVerifier][NewPM] Add method to run MF through verifier. #125701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions llvm/include/llvm/CodeGen/MachineFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,13 @@ class LLVM_ABI MachineFunction {
bool verify(Pass *p = nullptr, const char *Banner = nullptr,
raw_ostream *OS = nullptr, bool AbortOnError = true) const;

/// For New Pass Manager: Run the current MachineFunction through the machine
/// code verifier, useful for debugger use.
/// \returns true if no problems were found.
bool verify(MachineFunctionAnalysisManager &MFAM,
const char *Banner = nullptr, raw_ostream *OS = nullptr,
bool AbortOnError = true) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably should have one that separately takes all of the analyses (I thought I had a patch to do that for llvm-reduce)


/// Run the current MachineFunction through the machine code verifier, useful
/// for debugger use.
/// \returns true if no problems were found.
Expand Down
6 changes: 6 additions & 0 deletions llvm/lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ bool MachineFunction::verify(Pass *p, const char *Banner, raw_ostream *OS,
return MachineVerifier(p, Banner, OS, AbortOnError).verify(*this);
}

bool MachineFunction::verify(MachineFunctionAnalysisManager &MFAM,
const char *Banner, raw_ostream *OS,
bool AbortOnError) const {
return MachineVerifier(MFAM, Banner, OS, AbortOnError).verify(*this);
}

bool MachineFunction::verify(LiveIntervals *LiveInts, SlotIndexes *Indexes,
const char *Banner, raw_ostream *OS,
bool AbortOnError) const {
Expand Down