diff options
author | Florian Hahn <flo@fhahn.com> | 2021-11-09 12:56:22 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2021-11-09 12:57:03 +0000 |
commit | 2ead34716a8e294b1d22910c116e91732fc27320 (patch) | |
tree | 2296019f8f435ff45f254adcc28d7e9bd04bec1e /clang/lib/Basic/SourceManager.cpp | |
parent | b0de656bdf0ee3f4e51d04ae29160dab99819e8e (diff) | |
download | llvm-2ead34716a8e294b1d22910c116e91732fc27320.zip llvm-2ead34716a8e294b1d22910c116e91732fc27320.tar.gz llvm-2ead34716a8e294b1d22910c116e91732fc27320.tar.bz2 |
[SimplifyCFG] Add early bailout if Use is not in same BB.
Without this patch, passingValueIsAlwaysUndefined will iterate over all
instructions from I to the end of the basic block, even if the use is
outside the block.
This patch adds an early bail out, if the use instruction is outside I's
BB. This can greatly reduce compile-time in cases where very large basic
blocks are involved, with a large number of PHI nodes and incoming
values.
Note that the refactoring makes the handling of the case where I is a
phi and Use is in PHI more explicit as well: for phi nodes, we can also
directly bail out. In the existing code, we would iterate until we reach
the end and return false.
Based on an earlier patch by Matt Wala.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D113293
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions