summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2017-08-14 22:57:41 +0000
committerJessica Paquette <jpaquette@apple.com>2017-08-14 22:57:41 +0000
commit95c1107f4ccc73c5379c1226e6cfc638dfcfb857 (patch)
tree67d5a7f554a652784d23cb68b835661624af0ca0 /llvm/lib/CodeGen
parentb1e4b1a0704b426240368b75ddd206852bb03737 (diff)
downloadbcm5719-llvm-95c1107f4ccc73c5379c1226e6cfc638dfcfb857.tar.gz
bcm5719-llvm-95c1107f4ccc73c5379c1226e6cfc638dfcfb857.zip
[MachineOutliner] Only outline candidates of length >= 2
Since we don't factor in instruction lengths into outlining calculations right now, it's never the case that a candidate could have length < 2. Thus, we should quit early when we see such candidates. llvm-svn: 310894
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 36163538f4e..9a8eebff2b5 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -844,6 +844,13 @@ MachineOutliner::findCandidates(SuffixTree &ST, const TargetInstrInfo &TII,
// Figure out if this candidate is beneficial.
size_t StringLen = Leaf->ConcatLen - Leaf->size();
+
+ // Too short to be beneficial; skip it.
+ // FIXME: This isn't necessarily true for, say, X86. If we factor in
+ // instruction lengths we need more information than this.
+ if (StringLen < 2)
+ continue;
+
size_t CallOverhead = 0;
size_t SequenceOverhead = StringLen;
OpenPOWER on IntegriCloud