return 0x0;
}
- /// Insert a custom epilogue for outlined functions.
- /// This may be empty, in which case no epilogue or return statement will be
- /// emitted.
- virtual void insertOutlinerEpilogue(MachineBasicBlock &MBB,
+ /// Insert a custom frame for outlined functions.
+ virtual void buildOutlinedFrame(MachineBasicBlock &MBB,
MachineFunction &MF,
const outliner::TargetCostInfo &TCI) const {
llvm_unreachable(
- "Target didn't implement TargetInstrInfo::insertOutlinerEpilogue!");
+ "Target didn't implement TargetInstrInfo::buildOutlinedFrame!");
}
/// Insert a call to an outlined function into the program.
"Target didn't implement TargetInstrInfo::insertOutlinedCall!");
}
- /// Insert a custom prologue for outlined functions.
- /// This may be empty, in which case no prologue will be emitted.
- virtual void insertOutlinerPrologue(MachineBasicBlock &MBB,
- MachineFunction &MF,
- const outliner::TargetCostInfo &TCI) const {
- llvm_unreachable(
- "Target didn't implement TargetInstrInfo::insertOutlinerPrologue!");
- }
-
/// Return true if the function can safely be outlined from.
/// A function \p MF is considered safe for outlining if an outlined function
/// produced from instructions in F will produce a program which produces the
///
/// Targets must implement
/// * getOutliningCandidateInfo
-/// * insertOutlinerEpilogue
+/// * buildOutlinedFrame
/// * insertOutlinedCall
-/// * insertOutlinerPrologue
/// * isFunctionSafeToOutlineFrom
///
/// in order to make use of the MachineOutliner.
// Insert the new function into the module.
MF.insert(MF.begin(), &MBB);
- TII.insertOutlinerPrologue(MBB, MF, OF.TCI);
-
// Copy over the instructions for the function using the integer mappings in
// its sequence.
for (unsigned Str : OF.Sequence) {
MBB.insert(MBB.end(), NewMI);
}
- TII.insertOutlinerEpilogue(MBB, MF, OF.TCI);
+ TII.buildOutlinedFrame(MBB, MF, OF.TCI);
// If there's a DISubprogram associated with this outlined function, then
// emit debug info for the outlined function.
}
}
-void AArch64InstrInfo::insertOutlinerEpilogue(
+void AArch64InstrInfo::buildOutlinedFrame(
MachineBasicBlock &MBB, MachineFunction &MF,
const outliner::TargetCostInfo &TCI) const {
// For thunk outlining, rewrite the last instruction from a call to a
fixupPostOutline(MBB);
}
-void AArch64InstrInfo::insertOutlinerPrologue(
- MachineBasicBlock &MBB, MachineFunction &MF,
- const outliner::TargetCostInfo &TCI) const {}
-
MachineBasicBlock::iterator AArch64InstrInfo::insertOutlinedCall(
Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It,
MachineFunction &MF, const outliner::TargetCostInfo &TCI) const {
outliner::InstrType
getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags) const override;
unsigned getMachineOutlinerMBBFlags(MachineBasicBlock &MBB) const override;
- void insertOutlinerEpilogue(MachineBasicBlock &MBB, MachineFunction &MF,
- const outliner::TargetCostInfo &TCI) const override;
- void insertOutlinerPrologue(MachineBasicBlock &MBB, MachineFunction &MF,
+ void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF,
const outliner::TargetCostInfo &TCI) const override;
MachineBasicBlock::iterator
insertOutlinedCall(Module &M, MachineBasicBlock &MBB,
return outliner::InstrType::Legal;
}
-void X86InstrInfo::insertOutlinerEpilogue(MachineBasicBlock &MBB,
+void X86InstrInfo::buildOutlinedFrame(MachineBasicBlock &MBB,
MachineFunction &MF,
const outliner::TargetCostInfo &TCI)
const {
MBB.insert(MBB.end(), retq);
}
-void X86InstrInfo::insertOutlinerPrologue(MachineBasicBlock &MBB,
- MachineFunction &MF,
- const outliner::TargetCostInfo &TCI)
- const {}
-
MachineBasicBlock::iterator
X86InstrInfo::insertOutlinedCall(Module &M, MachineBasicBlock &MBB,
MachineBasicBlock::iterator &It,
outliner::InstrType
getOutliningType(MachineBasicBlock::iterator &MIT, unsigned Flags) const override;
- void insertOutlinerEpilogue(MachineBasicBlock &MBB, MachineFunction &MF,
- const outliner::TargetCostInfo &TCI) const override;
-
- void insertOutlinerPrologue(MachineBasicBlock &MBB, MachineFunction &MF,
+ void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF,
const outliner::TargetCostInfo &TCI) const override;
MachineBasicBlock::iterator