nir/sink: better handle uses outside the defining loop
Previously, for code like:
loop {
loop {
a = load_ubo()
}
use(a)
}
adjust_block_for_loops() would return the block before the first loop, causing an assert.
It could also sink load_ubo
to outside it's defining loop, which would break code created by nir_lower_non_uniform_access.
Edited by Rhys Perry