DFAPacketizer: Determining an instruction's functional unit after packetization.


I'm wondering how the Hexagon backend maps instructions to functional
units after instructions have been grouped into packets. The order of
instructions inside a packet appears to be random and the functional
unit information has been lost. How does the code emitter know which
functional unit an instruction is supposed to be dispatched to?



We have a patch that we have upstreamed yet that reorders the MIs in a bundle when they are being lowered into the MC layer.

We did this by using some bits in TSFlags to specify the insn type. With the insn type in hand, we could then, along with the scheduling class of the insn, determine not only the order, but also validate the packet formation restrictions, which is needed when assembling an assembler source.