aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-07-24 20:13:10 +0000
committerJessica Paquette <jpaquette@apple.com>2018-07-24 20:13:10 +0000
commit69f517df2777450ae6afdfed55419422aff95097 (patch)
treebf7a9735fe6a5116ec37673440cec3886a0a89c1 /llvm/lib/CodeGen/MachineOutliner.cpp
parente06bac4796bffed2b80649497afaadfb67d767cf (diff)
downloadllvm-69f517df2777450ae6afdfed55419422aff95097.zip
llvm-69f517df2777450ae6afdfed55419422aff95097.tar.gz
llvm-69f517df2777450ae6afdfed55419422aff95097.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp9
1 files changed, 4 insertions, 5 deletions
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 @@ unsigned MachineOutliner::findCandidates(
// 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 @@ MachineOutliner::createOutlinedFunction(Module &M, const OutlinedFunction &OF,
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.