This is a follow up to D141317 which extends the common code to include a target independent pseudo instruction. This is an alternative to (subset of) D92842 which tries to be as close to NFC as possible.
A couple things to call out for reviewers.
- I couldn't find a way to do tablegen matching for a generic SDAG node to a generic MI. I hacked this up, but surely there's something obvious I'm missing here? If not, I can cleanup the hacky code; I just didn't bother in the hopes there was a table gen based approach I'd missed.
- The test change in X86 is because we loose the scheduling information on the instruction. However, I think this was actually a bug in x86 since no instruction was emitted for a MEMBARRIER. Concluding that a meta instruction has latency just seems wrong?
- More generally, is there anything specifically I need to do around scheduling info for the generic instruction? I'm unfamiliar with that part of our system.
- I intentionally left some parts of D92842 out. Specifically, several of the changes in the X86 code (data independence and outlining) appear functional, and likely worthy of their own review. Additionally, I'm not handling ARM/AArch64 at all. Those targets need the ordering whereas none of the others do. I want to get this in and tested before retrofitting in ordering to support those targets.
I don't know of any target independent isel patterns today. I think all of the target independent opcodes are handled in this switch. The ones that do setNodeId(-1) are converted to MachineInstr in InstrEmitter.cpp.
Not sure what the "generalize op types" part of this comment means.