1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[MachineOutliner][NFC] Exit getOutliningType if there are < 2 candidates

Since we never outline anything with fewer than 2 occurrences, there's no
reason to compute cost model information if there's less than that.

llvm-svn: 346803
This commit is contained in:
Jessica Paquette 2018-11-13 22:16:27 +00:00
parent c3e6f1db48
commit 76d6c36f51
2 changed files with 5 additions and 4 deletions

View File

@ -1127,8 +1127,9 @@ unsigned MachineOutliner::findCandidates(
OutlinedFunction OF =
TII->getOutliningCandidateInfo(CandidatesForRepeatedSeq);
// If we deleted every candidate, then there's nothing to outline.
if (OF.Candidates.empty())
// If we deleted too many candidates, then there's nothing worth outlining.
// FIXME: This should take target-specified instruction sizes into account.
if (OF.Candidates.size() < 2)
continue;
std::vector<unsigned> Seq;

View File

@ -5165,8 +5165,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
CantGuaranteeValueAcrossCall),
RepeatedSequenceLocs.end());
// If the sequence is empty, we're done.
if (RepeatedSequenceLocs.empty())
// If the sequence doesn't have enough candidates left, then we're done.
if (RepeatedSequenceLocs.size() < 2)
return outliner::OutlinedFunction();
// At this point, we have only "safe" candidates to outline. Figure out