diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-06-26 05:10:45 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-06-26 05:10:45 +0000 |
commit | a37bb4a65d85ea453670288d07b76b9ce664466e (patch) | |
tree | aa61d66c64176f07855f1996c9e44da774f08f14 /llvm/lib/Transforms/Utils/CloneModule.cpp | |
parent | 7dda0edb5fd58699b8252133ccef2840f3830193 (diff) | |
download | llvm-a37bb4a65d85ea453670288d07b76b9ce664466e.zip llvm-a37bb4a65d85ea453670288d07b76b9ce664466e.tar.gz llvm-a37bb4a65d85ea453670288d07b76b9ce664466e.tar.bz2 |
[LoopUnswitch] Unswitch on conditions feeding into guards
Summary:
This is a straightforward extension of what LoopUnswitch does to
branches to guards. That is, we unswitch
```
for (;;) {
...
guard(loop_invariant_cond);
...
}
```
into
```
if (loop_invariant_cond) {
for (;;) {
...
// There is no need to emit guard(true)
...
}
} else {
for (;;) {
...
guard(false);
// SimplifyCFG will clean this up by adding an
// unreachable after the guard(false)
...
}
}
```
Reviewers: majnemer
Subscribers: mcrosier, llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D21725
llvm-svn: 273801
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
0 files changed, 0 insertions, 0 deletions