HomePhabricator

[LoopUnroll] Add multi-exit test which does not exit through latch.

Authored by fhahn on May 17 2021, 8:31 AM.

Description

[LoopUnroll] Add multi-exit test which does not exit through latch.

This patch adds a new test for loop-unrolling with multiple exiting
blocks, where the latch does not exit, but the header does. This can
happen when the loop has not been rotated, e.g. due to minsize.

Inspired by the following end-to-end test, using -Oz
https://godbolt.org/z/fP6sna8qK

bool foo(int *ptr, int limit) {
    #pragma clang loop unroll(full)
    for (unsigned int i = 0; i < 4; i++) {
        if (ptr[i] > limit)
        return false;
        ptr[i]++;
    }
    return true;
}

Details

Committed
fhahnMay 17 2021, 9:08 AM
Parents
rGf4c0fdc6c9db: [AMDGPU] Set unused dst_sel to '?' in the encoding
Branches
Unknown
Tags
Unknown