OSDN Git Service

[MachineOutliner] NFC: Throw out self-intersections on candidates early
authorJessica Paquette <jpaquette@apple.com>
Fri, 1 Dec 2017 21:56:56 +0000 (21:56 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 1 Dec 2017 21:56:56 +0000 (21:56 +0000)
commit55c1b415d451f34c805e617cb161497c22367b73
tree4f6c3d0d05ac2d7c5b57fddd1154d09b1f2d2c54
parentea21b4dca91813a96f4ccd654ed834749f45f4d9
[MachineOutliner] NFC: Throw out self-intersections on candidates early

Currently, the outliner considers candidates that intersect with themselves in
the candidate pruning step. That is, candidates of the form "AA" in ranges like
"AAAAAA". In that range, it looks like there are 5 instances of "AA" that could
possibly be outlined, and that's considered in the benefit calculation.

However, only at most 3 instances of "AA" could ever be outlined in "AAAAAA".
Thus, it's possible to pass through "AA" to the candidate selection step even
though it's *never* the case that "AA" could be outlined. This makes it so that
when we find candidates, we consider only non-overlapping occurrences of that
candidate.

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