From ed187b6e518050ee3ea07e2077d7de7ed58db65e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 8 Oct 2023 20:52:44 -0500 Subject: [PATCH] nak: Fix parallel copy handling in spilling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: --- src/nouveau/compiler/nak_spill_values.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak_spill_values.rs b/src/nouveau/compiler/nak_spill_values.rs index a0a464ba926..c30a4579f8b 100644 --- a/src/nouveau/compiler/nak_spill_values.rs +++ b/src/nouveau/compiler/nak_spill_values.rs @@ -619,7 +619,9 @@ fn spill_values( 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 = @@ -642,7 +644,7 @@ fn spill_values( 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); } } }