aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/MachineInstrTest.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2018-01-31 20:42:25 +0000
committerEli Friedman <efriedma@codeaurora.org>2018-01-31 20:42:25 +0000
commit79d297abe44aded6e829dedff8d7e3402cb971d4 (patch)
tree6972898ffb24f85588d8dbce612b7172ef17b29f /llvm/unittests/CodeGen/MachineInstrTest.cpp
parentd4bb329d0ea29bf6882b8f3bee9b944c161980a3 (diff)
downloadllvm-79d297abe44aded6e829dedff8d7e3402cb971d4.zip
llvm-79d297abe44aded6e829dedff8d7e3402cb971d4.tar.gz
llvm-79d297abe44aded6e829dedff8d7e3402cb971d4.tar.bz2
[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/unittests/CodeGen/MachineInstrTest.cpp')
0 files changed, 0 insertions, 0 deletions