This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] [NFC] add test for O0 pipeline
ClosedPublic

Authored by shchenz on Nov 29 2022, 6:36 PM.

Details

Reviewers
lkail
nemanjai
Group Reviewers
Restricted Project
Commits
rG4dfa12adddb7: [PowerPC] [NFC] add test for O0 pipeline
Summary

This is to address comments https://reviews.llvm.org/D138265#3950197

This should be helpful for detecting optimization passes added to O0 pipeline by mistake.

Diff Detail

Event Timeline

shchenz created this revision.Nov 29 2022, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2022, 6:36 PM
Herald added a subscriber: nemanjai. · View Herald Transcript
shchenz requested review of this revision.Nov 29 2022, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2022, 6:36 PM
lkail accepted this revision as: lkail.Nov 29 2022, 6:38 PM

LGTM.

This revision is now accepted and ready to land.Nov 29 2022, 6:38 PM
shchenz added inline comments.Nov 29 2022, 6:41 PM
llvm/test/CodeGen/PowerPC/O0-pipeline.ll
60

This pass seems should not be run at -O0?

lkail added inline comments.Nov 29 2022, 7:15 PM
llvm/test/CodeGen/PowerPC/O0-pipeline.ll
60

In this pass, we have

if (skipFunction(MF.getFunction()) || !RunPreEmitPeephole) {
  // Remove UNENCODED_NOP even when this pass is disabled.
  // This needs to be done unconditionally so we don't emit zeros
  // in the instruction stream.
  SmallVector<MachineInstr *, 4> InstrsToErase;
  for (MachineBasicBlock &MBB : MF)
    for (MachineInstr &MI : MBB)
      if (MI.getOpcode() == PPC::UNENCODED_NOP)
        InstrsToErase.push_back(&MI);
  for (MachineInstr *MI : InstrsToErase)
    MI->eraseFromParent();
  return false;
}

So I think it's essential to guarantee correct codegen.

This revision was automatically updated to reflect the committed changes.