This patch adds an outliner for AArch64. It adds the outliner target hooks to AArch64InstrInfo.cpp and AArch64InstrInfo.cpp. This allows for outlining using the -mno-red-zone and -enable-machine-outliner flags.
The main difference from the X86-64 outliner is the inclusion of post-outlining stack fixups. A function, getPostOutliningFixup is added to determine if an instruction that uses SP can be fixed up post-outlining. After each outlined function is created, fixupPostOutline is called on the MachineBasicBlock in that function, and recalculates stack offsets using getPostOutliningFixup.
For a simpler example of how this works, see https://reviews.llvm.org/D30797
We should only put short and performance critical functions into a header (and well templates force you sometimes).
It shouldn't be too hard to share code with getMemOpBaseRegImmOfsWidth() and for maintenance reasons we really should do so: