nir/cf: Conditionally do block_add_normal_succs() in unlink_jump();
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Sep 2015 01:04:14 +0000 (18:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Sep 2015 17:59:59 +0000 (10:59 -0700)
commit0991b2eb3535f9af289149c9e63c38b56cb4b549
treec00fec26ec47da79c15eafae4153ee7c53f64378
parent9674c76c0e473a3edbc45f935ea88afd64024325
nir/cf: Conditionally do block_add_normal_succs() in unlink_jump();

There is a bug where we mess up predecessors/successors due to the
ordering of unlinking/recreating edges/adding fake edges.  In order to
fix that, I need everything in one routine.

However, calling block_add_normal_succs() isn't safe from
cleanup_cf_node() - it would crash trying to insert phi undefs.
So unfortunately I need to add a parameter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir_control_flow.c