Skip to content

MachineFunctionPass: Clear properties before running function #67962

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
Oct 5, 2023
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
3 changes: 2 additions & 1 deletion llvm/lib/CodeGen/MachineFunctionPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ bool MachineFunctionPass::runOnFunction(Function &F) {
MF.print(OS);
}

MFProps.reset(ClearedProperties);

bool RV = runOnMachineFunction(MF);

if (ShouldEmitSizeRemarks) {
Expand All @@ -114,7 +116,6 @@ bool MachineFunctionPass::runOnFunction(Function &F) {
}

MFProps.set(SetProperties);
MFProps.reset(ClearedProperties);

// For --print-changed, print if the serialized MF has changed. Modes other
// than quiet/verbose are unimplemented and treated the same as 'quiet'.
Expand Down
8 changes: 0 additions & 8 deletions llvm/lib/CodeGen/RegisterCoalescer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4131,14 +4131,6 @@ bool RegisterCoalescer::runOnMachineFunction(MachineFunction &fn) {
else
JoinGlobalCopies = (EnableGlobalCopies == cl::BOU_TRUE);

// FIXME: MachineFunctionProperties cannot express the required pre-property
// no-SSA. When running a MIR testcase without any virtual register defs, the
// MIR parser assumes SSA. MachineFunctionPass::getClearedProperties is called
// after the pass is run, so the properties at this point say it's an SSA
// function. Forcibly clear it here so -verify-coalescing doesn't complain
// after multiple virtual register defs are introduced.
MRI->leaveSSA();

// If there are PHIs tracked by debug-info, they will need updating during
// coalescing. Build an index of those PHIs to ease updating.
SlotIndexes *Slots = LIS->getSlotIndexes();
Expand Down