This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Replace TransferImpOps with copyImplicitOps
ClosedPublic

Authored by john.brawn on Jul 14 2023, 8:18 AM.

Details

Summary

In most places where TransferImpOps is currently used we just have one machine instruction, so it's doing the same thing as copyImplicitOps
anyway. In those cases where we have more than one machine instruction the destination is written to in each instruction so any implicit defs should appear on all of them (and we shouldn't see any implicit refs as these pseudo-instruction don't have any register inputs), meaning the current use of TransferImpOps is incorrect and we should be using copyImplicitOps on all of the generated instructions.

Diff Detail

Event Timeline

john.brawn created this revision.Jul 14 2023, 8:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 8:18 AM
john.brawn requested review of this revision.Jul 14 2023, 8:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 8:18 AM

Looks like a nice cleanup. What happens when implicit uses are added to mulitple instructions? Could there be implicit killed uses that are added in multiple places and would not pass verification?

Looks like a nice cleanup. What happens when implicit uses are added to mulitple instructions? Could there be implicit killed uses that are added in multiple places and would not pass verification?

Writing some MIR to test this it does result in a machine verifier error. However I don't think these instructions will ever have implicit uses. As far as I can tell the only way an instruction can get an implicit use/def (when one isn't in the instruction description) is in VirtRegRewriter when there's a use/def of a sub-register of a super-register. These instructions don't have any register uses, so they can't get any implicit register uses in this way, so there's no problem.

dmgreen accepted this revision.Jul 18 2023, 2:13 AM

OK, sounds good so long as you are confident that won't cause a problem, and keep an eye on things in case they do. LGTM.

This revision is now accepted and ready to land.Jul 18 2023, 2:13 AM
This revision was landed with ongoing or failed builds.Jul 18 2023, 6:01 AM
This revision was automatically updated to reflect the committed changes.