This is an archive of the discontinued LLVM Phabricator instance.

MachineVerifier: Verify REG_SEQUENCE
ClosedPublic

Authored by arsenm on Sep 21 2022, 8:26 AM.

Details

Summary

Somehow there was no verification of this, other than an ad-hoc
assertion in TwoAddressInstructions.

Diff Detail

Event Timeline

arsenm created this revision.Sep 21 2022, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 8:26 AM
arsenm requested review of this revision.Sep 21 2022, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 8:26 AM
Herald added a subscriber: wdng. · View Herald Transcript
qcolombet accepted this revision.Sep 21 2022, 9:59 AM

Good catch @arsenm!

Overall LGTM. Just one missing case if I'm not mistaken.

llvm/lib/CodeGen/MachineVerifier.cpp
1940

Nit: For compactness, I would put MI->getOperand(I + 1) in its own variable.

llvm/test/MachineVerifier/verify-reg-sequence.mir
14

I think we miss a case in the test and in the verifier:

%val = REG_SEQUENCE <noOperands>
This revision is now accepted and ready to land.Sep 21 2022, 9:59 AM
arsenm closed this revision.Sep 22 2022, 6:53 AM
arsenm marked an inline comment as done.
llvm/test/MachineVerifier/verify-reg-sequence.mir
14

This one was free