diff options
| author | Eli Friedman <efriedma@codeaurora.org> | 2018-01-31 20:42:25 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@codeaurora.org> | 2018-01-31 20:42:25 +0000 |
| commit | 79d297abe44aded6e829dedff8d7e3402cb971d4 (patch) | |
| tree | 6972898ffb24f85588d8dbce612b7172ef17b29f /llvm/lib/CodeGen/MachineRegisterInfo.cpp | |
| parent | d4bb329d0ea29bf6882b8f3bee9b944c161980a3 (diff) | |
| download | bcm5719-llvm-79d297abe44aded6e829dedff8d7e3402cb971d4.tar.gz bcm5719-llvm-79d297abe44aded6e829dedff8d7e3402cb971d4.zip | |
[GlobalOpt] Fix exponential compile-time with selects.
If you have a long chain of select instructions created from something
like `int* p = &g; if (foo()) p += 4; if (foo2()) p += 4;` etc., a naive
recursive visitor will recursively visit each select twice, which is
O(2^N) in the number of select instructions. Use the visited set to cut
off recursion in this case.
(No testcase because this doesn't actually change the behavior, just the
time.)
Differential Revision: https://reviews.llvm.org/D42451
llvm-svn: 323910
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
0 files changed, 0 insertions, 0 deletions

