return false;
}
+ /// Returns true if the target implements the MachineOutliner.
+ virtual bool useMachineOutliner() const { return false; }
+
/// \brief Describes the number of instructions that it will take to call and
/// construct a frame for a given outlining candidate.
struct MachineOutlinerInfo {
MMI.getOrCreateMachineFunction(*M.begin()).getSubtarget();
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
const TargetInstrInfo *TII = STI.getInstrInfo();
-
+
+ // Does the target implement the MachineOutliner? If it doesn't, quit here.
+ if (!TII->useMachineOutliner()) {
+ // No. So we're done.
+ DEBUG(dbgs()
+ << "Skipping pass: Target does not support the MachineOutliner.\n");
+ return false;
+ }
+
InstructionMapper Mapper;
// Build instruction mappings for each function in the module. Start by
ArrayRef<std::pair<MachineMemOperand::Flags, const char *>>
getSerializableMachineMemOperandTargetFlags() const override;
+ /// AArch64 supports the MachineOutliner.
+ bool useMachineOutliner() const override { return true; }
+
bool
canOutlineWithoutLRSave(MachineBasicBlock::iterator &CallInsertionPt) const;
bool isFunctionSafeToOutlineFrom(MachineFunction &MF,
ArrayRef<std::pair<unsigned, const char *>>
getSerializableDirectMachineOperandTargetFlags() const override;
+ /// X86 supports the MachineOutliner.
+ bool useMachineOutliner() const override { return true; }
+
virtual MachineOutlinerInfo getOutlininingCandidateInfo(
std::vector<
std::pair<MachineBasicBlock::iterator, MachineBasicBlock::iterator>>