OSDN Git Service

[MachineOutliner] Don't store outlined function numberings on OutlinedFunction
authorJessica Paquette <jpaquette@apple.com>
Wed, 7 Nov 2018 18:36:43 +0000 (18:36 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 7 Nov 2018 18:36:43 +0000 (18:36 +0000)
commitfc6b6a704eea68966e85f70583cb4a78c74a4416
treeb7d99471b73ade1541593d0865dac86b8d2e25d0
parent06a55fc2f4556b1e47801514ce500dc316d8e38c
[MachineOutliner] Don't store outlined function numberings on OutlinedFunction

NFC-ish. This doesn't change the behaviour of the outliner, but does make sure
that you won't end up with say

OUTLINED_FUNCTION_2:
...
ret

OUTLINED_FUNCTION_248:
...
ret

as the only outlined functions in your module. Those should really be

OUTLINED_FUNCTION_0:
...
ret

OUTLINED_FUNCTION_1:
...
ret

If we produce outlined functions, they probably should have sequential numbers
attached to them. This makes it a bit easier+stable to write outliner tests.

The point of this is to move towards a bit more stability in outlined function
names. By doing this, we at least don't rely on the traversal order of the
suffix tree. Instead, we rely on the order of the candidate list, which is
*far* more consistent. The candidate list is ordered by the end indices of
candidates, so we're more likely to get a stable ordering. This is still
susceptible to changes in the cost model though (like, if we suddenly find new
candidates, for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346340 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineOutliner.h
lib/CodeGen/MachineOutliner.cpp