This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Split out MachineVerifier's liveness tracking
Needs ReviewPublic

Authored by arsenm on Jun 6 2022, 5:35 AM.

Details

Reviewers
qcolombet
MatzeB
Summary

The verifier has a much simpler liveness tracking interface than
LiveIntervals. For block reduction in llvm-reduce, I need to be able
to determine which virtual registers are live out of a block in order
to replace them with something equivalent. Having pre-constructed sets
of registers is a more convenient form for this.

test/CodeGen/X86/invalid-liveness.mir is somewhat broken. It now fails
in the verifier instead of testing the error handling in
LiveRangeCalc. We probably don't want a flag to have the MIR parser
skip the verifier in order to plow through to hit the original error.

Diff Detail

Event Timeline

arsenm created this revision.Jun 6 2022, 5:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 5:35 AM
Herald added subscribers: jsji, pmatos, asb and 6 others. · View Herald Transcript
arsenm requested review of this revision.Jun 6 2022, 5:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 5:35 AM
Herald added subscribers: aheejin, wdng. · View Herald Transcript

I didn't go into any detailed review here, but some top of the head thoughs:

  • We already have LiveIntervals which was supposed to be good enough for everyone. I agree that there is no efficient API for querying every vreg live at a certain program point. But I'd feel more comfortable adding a convenience or caching layer for that on top of LiveIntervals...
  • We already have a 2nd system LiveVariables (which we failed to actually deprecate enough to remove).
  • This is adding a 3rd one, so I think it ought to have some better justification than "simplicity over speed".