[MachineOutliner][NFC] Don't add MBBs with a size < 2 to the search space

The suffix tree won't ever consider sequences with a length less than 2.

Therefore, we really ought to not even consider them in the first place.

Also add a FIXME explaining that this should be defined in terms of the size
in B of an outlined call versus the size in B of the MBB.

llvm-svn: 342688
This commit is contained in:
Jessica Paquette 2018-09-20 21:53:25 +00:00
parent a071669956
commit b320ca2642
1 changed files with 5 additions and 1 deletions

View File

@ -1386,7 +1386,11 @@ void MachineOutliner::populateMapper(InstructionMapper &Mapper, Module &M,
for (MachineBasicBlock &MBB : *MF) {
// If there isn't anything in MBB, then there's no point in outlining from
// it.
if (MBB.empty())
// If there are fewer than 2 instructions in the MBB, then it can't ever
// contain something worth outlining.
// FIXME: This should be based off of the maximum size in B of an outlined
// call versus the size in B of the MBB.
if (MBB.empty() || MBB.size() < 2)
continue;
// Check if MBB could be the target of an indirect branch. If it is, then