Skip to content

nir/sink: better handle uses outside the defining loop

Rhys Perry requested to merge pendingchaos/mesa:nir_opt_sink_fix0 into master

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

Merge request reports