[MachineOutliner][NFC] Move target frame info into OutlinedFunction
Just some gardening here.
Similar to how we moved call information into Candidates, this moves outlined
frame information into OutlinedFunction. This allows us to remove
TargetCostInfo entirely.
Anywhere where we returned a TargetCostInfo struct, we now return an
OutlinedFunction. This establishes OutlinedFunctions as more of a general
repeated sequence, and Candidates as occurrences of those repeated sequences.
llvm-svn: 337848
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 99cc5f7..dfd9d14e 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -947,13 +947,12 @@
// We've found something we might want to outline.
// Create an OutlinedFunction to store it and check if it'd be beneficial
// to outline.
- TargetCostInfo TCI =
- TII.getOutliningCandidateInfo(CandidatesForRepeatedSeq);
+ OutlinedFunction OF = TII.getOutliningCandidateInfo(CandidatesForRepeatedSeq);
std::vector<unsigned> Seq;
for (unsigned i = Leaf->SuffixIdx; i < Leaf->SuffixIdx + StringLen; i++)
Seq.push_back(ST.Str[i]);
- OutlinedFunction OF(FunctionList.size(), CandidatesForRepeatedSeq, Seq,
- TCI);
+ OF.Sequence = Seq;
+ OF.Name = FunctionList.size();
// Is it better to outline this candidate than not?
if (OF.getBenefit() < 1) {
@@ -1166,7 +1165,7 @@
MBB.insert(MBB.end(), NewMI);
}
- TII.buildOutlinedFrame(MBB, MF, OF.TCI);
+ TII.buildOutlinedFrame(MBB, MF, OF);
// If there's a DISubprogram associated with this outlined function, then
// emit debug info for the outlined function.