Skip to content

nir/opt_if: Fix opt_if_simplification when else branch has jump

Danylo Piliaiev requested to merge GL/mesa:fix/3282-opt_if_simplification into master

Consider the following case:

 if ssa_1 {
    block block_2:
    /* succs: block_4 */
 } else {
    block block_3:
    ...
    break
    /* succs: block_5 */
 }

 block block_4:
 vec1 32 ssa_100 = phi block_2: ssa_2

After block_3 extraction and reinsertion, phi->pred becomes invalid and isn't updated by reinsertionsince it is unreachable from block_3.

Closes: #3282 (closed)
Fixes: e3e929f8

Intel CI: https://mesa-ci.01.org/global_logic/builds/279/group/63a9f0ea7bb98050796b649e85481845 - there are couple of failures due to already fixed "st/mesa: use fragment shader to copy stencil buffer" commit.

CI results for updated changes: https://mesa-ci.01.org/global_logic/builds/280/group/63a9f0ea7bb98050796b649e85481845

Edited by Danylo Piliaiev

Merge request reports