This is an archive of the discontinued LLVM Phabricator instance.

[MachineVerifier] Verify LiveIntervals for PHIs
ClosedPublic

Authored by critson on Aug 2 2023, 3:34 AM.

Details

Summary

Implement basic support for verifying LiveIntervals for PHIs.

Diff Detail

Event Timeline

critson created this revision.Aug 2 2023, 3:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 3:34 AM
critson requested review of this revision.Aug 2 2023, 3:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 3:34 AM

Interesting. Currently I don't think anything in LLVM tries to use LiveIntervals in SSA form, does it? Even -early-live-intervals only creates them just after PHIElimination.

llvm/lib/CodeGen/MachineVerifier.cpp
2521

Could the phi and non-phi cases be commoned some more? Is there any good reason to use SR.getVNInfoAt in one case vs SR.Query in the other?

critson updated this revision to Diff 546727.Aug 3 2023, 12:27 AM
critson marked an inline comment as done.
  • Simplify implementation to reuse existing query logic

Interesting. Currently I don't think anything in LLVM tries to use LiveIntervals in SSA form, does it? Even -early-live-intervals only creates them just after PHIElimination.

PHIElimination has code to preserve LiveIntervals, although it is incorrect/incomplete which I am currently fixing.
The code for '-early-live-intervals` also suggests the intention is for it to be run before PHIEliminination.

This probably fixes some of the issues I had getting llvm-reduce to always use LiveIntervals

llvm/lib/CodeGen/MachineVerifier.cpp
2529

Don't need parentheses around compare

llvm/test/CodeGen/AMDGPU/split-mbb-lis-subrange.mir
6–11

Don't need the IR section

critson updated this revision to Diff 550657.Aug 16 2023, 1:21 AM
  • Address reviewer comments
arsenm accepted this revision.Aug 17 2023, 5:59 AM
This revision is now accepted and ready to land.Aug 17 2023, 5:59 AM
This revision was landed with ongoing or failed builds.Aug 18 2023, 2:14 AM
This revision was automatically updated to reflect the committed changes.