Skip to content

[NFC] Simplify checks using isDebugOrPseudoInstr API #145127

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/MachineSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ MachineSinking::getBBRegisterPressure(const MachineBasicBlock &MBB,
MIE = MBB.instr_begin();
MII != MIE; --MII) {
const MachineInstr &MI = *std::prev(MII);
if (MI.isDebugInstr() || MI.isPseudoProbe())
if (MI.isDebugOrPseudoInstr())
continue;
RegisterOperands RegOpers;
RegOpers.collect(MI, *TRI, *MRI, false, false);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/RegisterPressure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ void RegPressureTracker::recedeSkipDebugValues() {

void RegPressureTracker::recede(SmallVectorImpl<VRegMaskOrUnit> *LiveUses) {
recedeSkipDebugValues();
if (CurrPos->isDebugInstr() || CurrPos->isPseudoProbe()) {
if (CurrPos->isDebugOrPseudoInstr()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the isDebugOrPseudoInstr name is confusing. We already have multiple notions of "pseudoinstructions" and specifically PseudoProbe isn't one of them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, any suggestions? would isDebugOrPseudoProbeInstr be better?

Would it be ok to check in the current diff first? as the changes are independent of the naming, I'll create a separate diff for the name change.

// It's possible to only have debug_value and pseudo probe instructions and
// hit the start of the block.
assert(CurrPos == MBB->begin());
Expand Down
Loading