[MachineOutliner][NFC] Remember when you map something illegal across MBBs
authorJessica Paquette <jpaquette@apple.com>
Thu, 1 Nov 2018 23:09:06 +0000 (23:09 +0000)
committerJessica Paquette <jpaquette@apple.com>
Thu, 1 Nov 2018 23:09:06 +0000 (23:09 +0000)
commitc991cf3687ee1ad8744a3037c351a035fcbf3133
tree70b78729f819db3af970085edc33ecfd74060e95
parente8c650ab126bc67cc4dffa0b8671c635079fc786
[MachineOutliner][NFC] Remember when you map something illegal across MBBs

Instruction mapping in the outliner uses "illegal numbers" to signify that
something can't ever be part of an outlining candidate. This means that the
number is unique and can't be part of any repeated substring.

Because each of these is unique, we can use a single unique number to represent
a range of things we can't outline.

The outliner tries to leverage this using a flag which is set in an MBB when
the previous instruction we tried to map was "illegal". This patch improves
that logic to work across MBBs. As a bonus, this also simplifies the mapping
logic somewhat.

This also updates the machine-outliner-remarks test, which was impacted by the
order of Candidates on an OutlinedFunction changing. This order isn't
guaranteed, so I added a FIXME to fix that in a follow-up. The order of
Candidates on an OutlinedFunction isn't important, so this still is NFC.

llvm-svn: 345906
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/test/CodeGen/AArch64/machine-outliner-remarks.ll