OSDN Git Service

[MachineOutliner] Outline functions by order of benefit
authorJessica Paquette <jpaquette@apple.com>
Wed, 5 Dec 2018 21:36:04 +0000 (21:36 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 5 Dec 2018 21:36:04 +0000 (21:36 +0000)
commita5d8d4c7c9404311ac832e88677d9ecf0b3855b5
treea35db90455f6e1e1d47a46f3dae4cbb757d9b80f
parent83757df6cccb719cb0bdfe54e5611d5f626c47dc
[MachineOutliner] Outline functions by order of benefit

Mostly NFC, only change is the order of outlined function names.

Loop over the outlined functions instead of walking the candidate list.

This is a bit easier to understand. It's far more natural to create a function,
then replace all of its occurrences with calls than the other way around.

The functions outlined after this do not change, but their names will be
decided by their benefit. E.g, OUTLINED_FUNCTION_0 will now always be the
most beneficial function, rather than the first one seen.

This makes it easier to enforce an ordering on the outlined functions. So,
this also adds a test to make sure that the ordering works as expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348414 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineOutliner.h
lib/CodeGen/MachineOutliner.cpp
test/CodeGen/AArch64/machine-outliner-ordering.mir [new file with mode: 0644]