nak: Fix parallel copy handling in spilling

Only consider copies with the right file.  Otherwise, the spill chooser
will blow up looking for the next use.  Also, we were marking
destinations as spilled when I ment to mark them as being in W.  This
was a right mess.  God thing to_cssa() was also broken so it wasn't
inserting nearly as many parallel copies as it was supposed to. 🙃

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
Faith Ekstrand
2023-10-08 20:52:44 -05:00
committed by Marge Bot
parent 2ff6a36e2a
commit ed187b6e51
+4 -2
View File
@@ -619,7 +619,9 @@ fn spill_values<S: Spill>(
let mut spills = SpillChooser::new(bl, ip, count);
for (dst, _) in pcopy.dsts_srcs.iter() {
let dst_ssa = &dst.as_ssa().unwrap()[0];
spills.add_candidate(*dst_ssa);
if dst_ssa.file() == file {
spills.add_candidate(*dst_ssa);
}
}
let spills: HashSet<SSAValue> =
@@ -642,7 +644,7 @@ fn spill_values<S: Spill>(
for (dst, _) in pcopy.dsts_srcs.iter() {
let dst_ssa = &dst.as_ssa().unwrap()[0];
if dst_ssa.file() == file {
b.s.insert(*dst_ssa);
b.w.insert(*dst_ssa);
}
}
}