diff options
author | Anna Thomas <anna@azul.com> | 2017-05-03 11:47:11 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-05-03 11:47:11 +0000 |
commit | 53c8d95c850eb2a97962882c9c0effe98a917f41 (patch) | |
tree | e81a826c09892c3a3413f925cbdb998e802ba3ff /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | c30d85bd8aad17f1235904a00b27181a7e29a952 (diff) | |
download | bcm5719-llvm-53c8d95c850eb2a97962882c9c0effe98a917f41.tar.gz bcm5719-llvm-53c8d95c850eb2a97962882c9c0effe98a917f41.zip |
[Loop Deletion] Delete loops that are never executed
Summary:
Currently, loop deletion deletes loop where the only values
that are used outside the loop are loop-invariant.
This patch adds logic to delete loops where the loop is proven to be
never executed (i.e. the only predecessor of the loop preheader has a
constant conditional branch as terminator, and the preheader is not the
taken target). This will remove loops that become dead after
loop-unswitching generates constant conditional branches.
The next steps are:
1. moving the loop deletion implementation to LoopUtils.
2. Add logic in loop-simplifyCFG which will support changing conditional
constant branches to unconditional branches. If loops become unreachable in this
process, they can be removed using `deleteDeadLoop` function.
Reviewers: chandlerc, efriedma, sanjoy, reames
Reviewed by: sanjoy
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32494
llvm-svn: 302015
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
0 files changed, 0 insertions, 0 deletions