diff options
author | Joshua Cao <cao.joshua@yahoo.com> | 2023-12-02 11:24:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-02 11:24:02 -0800 |
commit | 5602636835e3fe655d196428091a64abd1837966 (patch) | |
tree | a59ee2bcac92d762260548196d4896c3dab26769 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 0008b9c0ac284e0303d9db1745d243975d8642d8 (diff) | |
download | llvm-5602636835e3fe655d196428091a64abd1837966.zip llvm-5602636835e3fe655d196428091a64abd1837966.tar.gz llvm-5602636835e3fe655d196428091a64abd1837966.tar.bz2 |
[LoopPeel] Peel iterations based on and, or conditions (#73413)
For example, this allows us to peel this loop with a `and`:
```
for (int i = 0; i < N; ++i) {
if (i % 2 == 0 && i < 3) // can peel based on || as well
f1();
f2();
```
into:
```
for (int i = 0; i < 3; ++i) { // peel three iterations
if (i % 2 == 0)
f1();
f2();
}
for (int i = 3; i < N; ++i)
f2();
```
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions