This is an archive of the discontinued LLVM Phabricator instance.

[MachineInstr] Don't include debug uses in bundle header (PR52817)
ClosedPublic

Authored by nikic on Jan 10 2022, 7:29 AM.

Details

Summary

Following https://github.com/llvm/llvm-project/issues/52817#issuecomment-1007635426, this excludes debug instructions when finalizing the bundle. Uses in debug instructions will no longer be included in the BUNDLE header.

This also ends up dropping the "internal" modifier for debug instructions -- not sure whether that's good or bad. If that should be retained, I can change the patch accordingly.

Fixes https://github.com/llvm/llvm-project/issues/52817.

Diff Detail

Event Timeline

nikic created this revision.Jan 10 2022, 7:29 AM
nikic requested review of this revision.Jan 10 2022, 7:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2022, 7:29 AM
fhahn added a subscriber: fhahn.

Adding a couple of reviewers that may be familiar with debug info + bundle interaction.

  • Loosing the internal flag for uses that don't really read the register seems fine to me.
  • Added a suggestion to try MachineOperand::readsReg() instead of checking for debug instructions.
llvm/lib/CodeGen/MachineInstrBundle.cpp
147–158

Does checking MO.readsReg() work as well? I looks like we may have a similar problem with undef operands.

MatzeB accepted this revision.Jan 13 2022, 10:17 AM

Please try the suggestion. Either way LGTM.

This revision is now accepted and ready to land.Jan 13 2022, 10:17 AM
nikic added inline comments.Jan 14 2022, 2:21 AM
llvm/lib/CodeGen/MachineInstrBundle.cpp
147–158

Nope, that doesn't work. It looks like MO.readsReg() returns true for DBG_VALUE uses.

This revision was landed with ongoing or failed builds.Jan 17 2022, 1:43 AM
This revision was automatically updated to reflect the committed changes.