mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 08:10:09 +01:00
nak: fix clippy::while_let_loop warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27234>
This commit is contained in:
parent
1effb5262a
commit
4d414cb61a
2 changed files with 9 additions and 23 deletions
|
|
@ -248,12 +248,8 @@ impl Function {
|
|||
for (_, p_ssa) in phi.srcs.iter_mut() {
|
||||
// Apply the remap to the phi sources so that we
|
||||
// pick up any remaps from previous loop iterations.
|
||||
loop {
|
||||
if let Some(new_ssa) = ssa_map.get(p_ssa) {
|
||||
*p_ssa = *new_ssa;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
while let Some(new_ssa) = ssa_map.get(p_ssa) {
|
||||
*p_ssa = *new_ssa;
|
||||
}
|
||||
|
||||
if *p_ssa == phi.dst {
|
||||
|
|
@ -306,11 +302,9 @@ impl Function {
|
|||
// Fix up any remapped SSA values in sources
|
||||
if !ssa_map.is_empty() {
|
||||
for instr in &mut bb.instrs {
|
||||
instr.for_each_ssa_use_mut(|ssa| loop {
|
||||
if let Some(new_ssa) = ssa_map.get(ssa) {
|
||||
instr.for_each_ssa_use_mut(|ssa| {
|
||||
while let Some(new_ssa) = ssa_map.get(ssa) {
|
||||
*ssa = *new_ssa;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -322,12 +316,8 @@ impl Function {
|
|||
let phi_src = get_or_insert_phi_srcs(bb);
|
||||
for phi in s_phis.iter() {
|
||||
let mut ssa = phi.srcs.get(&b_idx).unwrap();
|
||||
loop {
|
||||
if let Some(new_ssa) = ssa_map.get(ssa) {
|
||||
ssa = new_ssa;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
while let Some(new_ssa) = ssa_map.get(ssa) {
|
||||
ssa = new_ssa;
|
||||
}
|
||||
phi_src.srcs.push(phi.idx, (*ssa).into());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,13 +211,9 @@ impl<'a> CoalesceGraph<'a> {
|
|||
let mut dom = Vec::new();
|
||||
|
||||
for n in MergedIter::new(a.nodes.iter(), b.nodes.iter()) {
|
||||
loop {
|
||||
if let Some(p) = dom.last() {
|
||||
if !self.node_dominates(*p, *n, cfg) {
|
||||
dom.pop();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
while let Some(p) = dom.last() {
|
||||
if !self.node_dominates(*p, *n, cfg) {
|
||||
dom.pop();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue