This is an archive of the discontinued LLVM Phabricator instance.

[MachineVerifier] Add check that tied physregs aren't different.
ClosedPublic

Authored by JesperAntonsson on Jun 20 2017, 4:43 AM.

Details

Summary

Added MachineVerifier code to check register ties more thoroughly, especially so that physical registers that are tied are the same. This may help e.g. when creating MIR files.

Diff Detail

Repository
rL LLVM

Event Timeline

Missed adding llvm-commits as subscriber initially. Adding this note as a ping to the mailing list.

qcolombet added inline comments.
lib/CodeGen/MachineVerifier.cpp
993 ↗(On Diff #103184)

I'm not sure about that one.
Theoretically, you could have a not yet allocated vreg here. As long as the allocation does the right thing with the tie, that isn't an error.

test/CodeGen/MIR/X86/subregister-index-operands.mir
27 ↗(On Diff #103184)

I would expect we add a new test instead of modifying this one.
In particular I don't think this one is going to fail when you modify the isPhysicalRegister check that I mentioned earlier.

lib/CodeGen/MachineVerifier.cpp
993 ↗(On Diff #103184)

Thanks for reviewing. Ok, so it's allowed to mix physregs and vregs? I'll upload a new patch that removes this check then.

test/CodeGen/MIR/X86/subregister-index-operands.mir
27 ↗(On Diff #103184)

Agreed, it won't fail, so I'll just leave this test as is.

Removed the check that tied physregs and virtregs aren't mixed. Removed changes in a test that had such mixes.

JesperAntonsson marked 2 inline comments as done.Jun 22 2017, 4:46 AM

Ping. How about it? Could we land this patch?

Could you add a .mir test case that exposes this verifier diagnostic? (In test/CodeGen/MIR then pick a target)

Other than that, LGTM.

Added a MIR test for the check. Thanks to Quentin for input.

qcolombet accepted this revision.Jul 5 2017, 10:07 AM
This revision is now accepted and ready to land.Jul 5 2017, 10:07 AM
This revision was automatically updated to reflect the committed changes.