summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-11-13 22:16:27 +0000
committerJessica Paquette <jpaquette@apple.com>2018-11-13 22:16:27 +0000
commitb2d53c5d7d8f6e14b9705cca59078e584a7c2951 (patch)
tree1d8f0c926209e37060ab0900f3da4330a701c4b5 /llvm/lib/CodeGen
parentc03328a7c09ffb74af0f82082665388eef7cf735 (diff)
downloadbcm5719-llvm-b2d53c5d7d8f6e14b9705cca59078e584a7c2951.tar.gz
bcm5719-llvm-b2d53c5d7d8f6e14b9705cca59078e584a7c2951.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 1a3a2cfb93e..6b9faddd9b2 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -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;
OpenPOWER on IntegriCloud