This is an archive of the discontinued LLVM Phabricator instance.

[MachineVerifier] Try harder to verify LiveIntervals
ClosedPublic

Authored by foad on Jul 6 2022, 7:59 AM.

Details

Summary

Verify the LiveIntervals analysis after a pass that claims to preserve
it, even if there are no further passes (apart from the verifier itself)
that would use the analysis.

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

Diff Detail

Event Timeline

foad created this revision.Jul 6 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 7:59 AM
foad requested review of this revision.Jul 6 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 7:59 AM
foad added inline comments.Jul 6 2022, 8:04 AM
llvm/test/CodeGen/AMDGPU/si-lower-control-flow.mir
33

This is a side effect of LiveIntervals being available when SILowerControlFlow runs.

SILowerControlFlow says:

// This doesn't actually need LiveIntervals, but we can preserve them.
LIS = getAnalysisIfAvailable<LiveIntervals>();

but in fact the presence of LiveIntervals does affect the output as shown by these diffs, so the perhaps the pass should call AU.addUsedIfAvailable<LiveIntervals>() in its getAnalysisUsage?

foad added a comment.Jul 11 2022, 8:17 AM
FIXME: Hexagon tests fail with:
*** Bad machine code: Multiple connected components in live interval ***
after Hexagon Expand Condsets.

This is https://github.com/llvm/llvm-project/issues/56050

foad added a comment.Jul 11 2022, 8:19 AM
FIXME: Other AMDGPU tests fail with
*** Bad machine code: Multiple connected components in live interval ***
after SI optimize exec mask operations pre-RA.

This is https://github.com/llvm/llvm-project/issues/56051

foad updated this revision to Diff 443907.Jul 12 2022, 3:36 AM

Rebase on D129555.

foad added inline comments.
llvm/test/CodeGen/AMDGPU/si-lower-control-flow.mir
33

Done in D129555.

arsenm accepted this revision.Jul 26 2022, 4:57 PM
This revision is now accepted and ready to land.Jul 26 2022, 4:57 PM
foad updated this revision to Diff 453933.Aug 19 2022, 2:14 AM

Rebase.

foad edited the summary of this revision. (Show Details)Aug 19 2022, 2:14 AM
arsenm accepted this revision.Sep 16 2022, 9:23 AM
foad edited the summary of this revision. (Show Details)Oct 21 2022, 5:50 AM
foad updated this revision to Diff 495057.Feb 6 2023, 2:59 AM

Rebase

foad edited the summary of this revision. (Show Details)Apr 8 2023, 2:54 AM
foad updated this revision to Diff 524752.May 23 2023, 9:03 AM

Update checks in statepoint-cmp-sunk-past-statepoint.ll

foad added a subscriber: kparzysz.May 24 2023, 2:47 AM
This comment was removed by foad.
foad updated this revision to Diff 525109.May 24 2023, 4:51 AM

Remove a failing test as suggested in D151227. Remove some workarounds.

foad edited the summary of this revision. (Show Details)May 24 2023, 4:52 AM
foad added reviewers: fhahn, MatzeB, qcolombet, kparzysz.
arsenm accepted this revision.May 24 2023, 8:03 AM
fhahn accepted this revision.May 24 2023, 8:07 AM

LGTM, thanks!

This revision was automatically updated to reflect the committed changes.