forked from OSchip/llvm-project
[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
This commit is contained in:
parent
b1e4b1a070
commit
95c1107f4c
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue