Pre-register allocation callback

     I would like to implement in the back end a pre-register allocation (R.A.) small "pass" (in which I bundle some MachineInstr).
     So far I've managed to implement in method bool [Target]InstrInfo::expandPostRAPseudo(MachineInstr &MI), after R.A. as the name of the method implies, my small "pass", relying on the fact I actually want to treat only INLINEASM instructions, which are considered pseudo-instructions.

     Is there already a callback like expandPostRAPseudo() in [Target]InstrInfo or some other class where I can implement my small "pass" before R.A.? (I could implement a new machine pass registered before R.A., but I ask since maybe there is a simpler solution.)

   Thank you,

TargetPassConfig is responsible for setting up the codegen pipeline. Most of its functions can be overridden to customize it for your target. Overriding addPreRegAlloc() may be useful in your case, an alternative that would be insertPass() which allows you to insert somthing after a given pass (though that is more bittle and I'd rather recommend the override method).

- Matthias