At the end of a loop, there are two possible scenarios:
the loop will be taken again
the loop will be exited
Currently barrier insertion conflates the two, but sometimes more precise barriers could be inserted for the individual scenarios.
This is easy noticed for example on 1-trip loops such as in CGO17's Convolution Row benchmark.
We know that the loop is only taken once, but we stil insert a barrier for scenario 1. at the end of the loop.
At the end of a loop, there are two possible scenarios:
Currently barrier insertion conflates the two, but sometimes more precise barriers could be inserted for the individual scenarios. This is easy noticed for example on 1-trip loops such as in CGO17's Convolution Row benchmark. We know that the loop is only taken once, but we stil insert a barrier for scenario 1. at the end of the loop.