nak: Use op instead of phi when referring to OpPhiSrcs or OpPhiDsts

This will reduce name conflicts in the next patch

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34994>
This commit is contained in:
Faith Ekstrand
2025-05-15 18:17:20 -04:00
parent 5f5ce00410
commit 531070cf91
3 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -1014,8 +1014,8 @@ impl AssignRegsBlock {
self.ra.free_killed(dsts_killed);
None
}
Op::PhiSrcs(phi) => {
for (id, src) in phi.srcs.iter() {
Op::PhiSrcs(op) => {
for (id, src) in op.srcs.iter() {
assert!(src.is_unmodified());
if let Some(ssa) = src_ssa_ref(src) {
assert!(ssa.comps() == 1);
@@ -1028,10 +1028,10 @@ impl AssignRegsBlock {
assert!(dsts_killed.is_empty());
None
}
Op::PhiDsts(phi) => {
Op::PhiDsts(op) => {
assert!(instr.pred.is_true());
for (id, dst) in phi.dsts.iter() {
for (id, dst) in op.dsts.iter() {
if let Dst::SSA(ssa) = dst {
assert!(ssa.comps() == 1);
let reg = self.alloc_scalar(ip, sum, phi_webs, ssa[0]);
+2 -2
View File
@@ -119,7 +119,7 @@ fn get_or_insert_phi_dsts(bb: &mut BasicBlock) -> &mut OpPhiDsts {
0
};
match &mut bb.instrs[ip].op {
Op::PhiDsts(phi) => phi,
Op::PhiDsts(op) => op,
_ => panic!("Expected to find the phi we just inserted"),
}
}
@@ -135,7 +135,7 @@ fn get_or_insert_phi_srcs(bb: &mut BasicBlock) -> &mut OpPhiSrcs {
bb.instrs.len() - 1
};
match &mut bb.instrs[ip].op {
Op::PhiSrcs(phi) => phi,
Op::PhiSrcs(op) => op,
_ => panic!("Expected to find the phi we just inserted"),
}
}
+8 -8
View File
@@ -33,8 +33,8 @@ impl PhiDstMap {
pub fn from_block(block: &BasicBlock) -> PhiDstMap {
let mut map = PhiDstMap::new();
if let Some(phi) = block.phi_dsts() {
for (idx, dst) in phi.dsts.iter() {
if let Some(op) = block.phi_dsts() {
for (idx, dst) in op.dsts.iter() {
map.add_phi_dst(*idx, dst);
}
}
@@ -66,8 +66,8 @@ impl PhiSrcMap {
pub fn from_block(block: &BasicBlock) -> PhiSrcMap {
let mut map = PhiSrcMap::new();
if let Some(phi) = block.phi_srcs() {
for (idx, src) in phi.srcs.iter() {
if let Some(op) = block.phi_srcs() {
for (idx, src) in op.srcs.iter() {
map.add_phi_src(*idx, src);
}
}
@@ -705,10 +705,10 @@ fn spill_values<S: Spill>(
}
match &mut instr.op {
Op::PhiDsts(phi) => {
Op::PhiDsts(op) => {
// For phis, anything that is not in W needs to be spilled
// by setting the destination to some spill value.
for (idx, dst) in phi.dsts.iter_mut() {
for (idx, dst) in op.dsts.iter_mut() {
let vec = dst.as_ssa().unwrap();
debug_assert!(vec.comps() == 1);
let ssa = &vec[0];
@@ -973,8 +973,8 @@ fn spill_values<S: Spill>(
let mut spills = Vec::new();
let mut fills = Vec::new();
if let Some(phi) = pb.phi_srcs_mut() {
for (idx, src) in phi.srcs.iter_mut() {
if let Some(op) = pb.phi_srcs_mut() {
for (idx, src) in op.srcs.iter_mut() {
debug_assert!(src.is_unmodified());
let vec = src.src_ref.as_ssa().unwrap();
debug_assert!(vec.comps() == 1);