summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
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