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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.
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.