Annotating DAG with locations for specific machine instructions

I have a target-specific LoopPass which checks loops to see whether some machine-specific instructions can be profitably used and needs to mark them in a way that can easily be seen during machine instruction lowering. So what I imagine could work is inserting pseudo-instructions, e.g. at the end of the loop header - but I haven’t seen how to do this through IRBuilder or recognized an equivalent action being performed on other targets. Please point me at an example of this approach (or educate me on why it’s never going to work…)

if i understand well, Hexagon backend may have what you need. HexagonHardwareLoops.cpp to begin.

Have you thought of inserting intrinsics into the IR and then picking them up and removing them in the backend?

  • Ryan