The way we do it for Hexagon is that we have our own specialization of the MachineScheduler pass, followed by a packetizer pass. Actually, we run two schedulers: machine scheduler, and post-RA scheduler, but that doesn’t change much conceptually. In the scheduler passes we don’t form instruction packets, at least not explicitly. We do some sort of a simulation of “what if we were forming packets right now” type of thing, maximizing packetization opportunities ahead of time, before the packetization itself, hoping that enough of it will prevail.
Finally, near the end of the post-RA passes we do run the DFAPacketizer pass which forms the actual packets (i.e. “bundles” in LLVM terminology). The DFA packetizer relies on tables that are generated out of your target’s td files describing your processor’s resources (some of which the standard scheduler uses as well).
If you’re starting from scratch, I’d get the packetizer working first.
--
Krzysztof Parzyszek kpar...@quicinc.com AI tools development
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev