Some functionality cannot be accessed directly from templates in a
straightforward generic way at all, and other functionality could be
accessed but only inefficiently.
Examples are:
- Given an SSA value, determining the basic block in which it is defined (if any) isn't possible in MachineIR without access to MachineRegisterInfo.
- Printing an llvm::Value properly requires a ModuleSlotTracker whose creation is expensive. Printing large functions can become prohibitively slow unless the ModuleSlotTracker is cached.
Each supported IR provides an implementation of the SsaContext
"concept" defined in this patch through which such functionality can be
exposed.
Change-Id: I7ed2b5c7698e6f3784db6201bcdb842173e23379