diff options
author | Florian Hahn <flo@fhahn.com> | 2019-10-02 07:37:41 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-10-02 07:37:41 +0000 |
commit | 167b0529be766a85db3c0811607ac60f821670ff (patch) | |
tree | e703085c499920aaae4d5b00d5701a4f25202188 /llvm/lib/CodeGen | |
parent | 1c57143742b1deab32ac96cfd24c6b9dc9868a21 (diff) | |
download | bcm5719-llvm-167b0529be766a85db3c0811607ac60f821670ff.tar.gz bcm5719-llvm-167b0529be766a85db3c0811607ac60f821670ff.zip |
[Local] Simplify function removeUnreachableBlocks() to avoid (re-)computation.
Two small changes in llvm::removeUnreachableBlocks() to avoid unnecessary (re-)computation.
First, replace the use of count() with find(), which has better time complexity.
Second, because we have already computed the set of dead blocks, replace the second loop over all basic blocks to a loop only over the already computed dead blocks. This simplifies the loop and avoids recomputation.
Patch by Rodrigo Caetano Rocha <rcor.cs@gmail.com>
Reviewers: efriedma, spatel, fhahn, xbolva00
Reviewed By: fhahn, xbolva00
Differential Revision: https://reviews.llvm.org/D68191
llvm-svn: 373429
Diffstat (limited to 'llvm/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions