nak/spill_values: Don't assume no trivial phis

Thanks to LCSSA, we can absolutely have phis with only one source and we
need to handle those in spilling.  Fortunately, there's nothing really
special about that case.  I was just prematurely optimizing.

Fixes: bcad2add47 ("nak: Add a spilling pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28084>
This commit is contained in:
Faith Ekstrand 2024-07-23 14:13:12 -05:00 committed by Marge Bot
parent 305bf503e7
commit 8bf3213a54

View file

@ -899,14 +899,6 @@ fn spill_values<S: Spill>(
}
let s_idx = succ[0];
// If blocks[p_idx] is the unique predecessor of blocks[s_idx] then the
// spill/fill sets for blocks[s_idx] are just those from blocks[p_idx],
// filtered for liveness and there is no phi source. There's nothing
// for us to do here.
if blocks.pred_indices(s_idx).len() == 1 {
continue;
}
let pb = &mut blocks[p_idx];
let p_out = &ssa_state_out[p_idx];
let s_in = &ssa_state_in[s_idx];