mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 04:20:18 +01:00
nak: collapse extraneous conditional branches
v2: Revert collapsing of branches per review Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34372>
This commit is contained in:
parent
451b37820d
commit
f2cc77dca8
4 changed files with 18 additions and 25 deletions
|
|
@ -3650,13 +3650,14 @@ impl<'a> ShaderFromNir<'a> {
|
|||
b.push_op(phi);
|
||||
}
|
||||
|
||||
if self.sm.sm() < 70 && nb.cf_node.prev().is_none() {
|
||||
if let Some(_) = nb.parent().as_loop() {
|
||||
b.push_op(OpPCnt {
|
||||
target: self.get_block_label(nb),
|
||||
});
|
||||
self.push_crs(nb, SyncType::Cont);
|
||||
}
|
||||
if self.sm.sm() < 70
|
||||
&& nb.cf_node.prev().is_none()
|
||||
&& nb.parent().as_loop().is_some()
|
||||
{
|
||||
b.push_op(OpPCnt {
|
||||
target: self.get_block_label(nb),
|
||||
});
|
||||
self.push_crs(nb, SyncType::Cont);
|
||||
}
|
||||
|
||||
let mut goto = None;
|
||||
|
|
|
|||
|
|
@ -260,12 +260,10 @@ impl BlockLiveness for SimpleBlockLiveness {
|
|||
fn is_live_after_ip(&self, val: &SSAValue, ip: usize) -> bool {
|
||||
if self.live_out.get(val.idx().try_into().unwrap()) {
|
||||
true
|
||||
} else if let Some(last_use_ip) = self.last_use.get(&val.idx()) {
|
||||
*last_use_ip > ip
|
||||
} else {
|
||||
if let Some(last_use_ip) = self.last_use.get(&val.idx()) {
|
||||
*last_use_ip > ip
|
||||
} else {
|
||||
false
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@ fn should_lower_to_warp(
|
|||
}
|
||||
});
|
||||
|
||||
if num_non_uniform_srcs >= 2 {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
num_non_uniform_srcs >= 2
|
||||
}
|
||||
|
||||
fn propagate_r2ur(
|
||||
|
|
|
|||
|
|
@ -61,15 +61,13 @@ fn get_ssa_or_phi(
|
|||
// This is a loop back-edge, add a phi just in case. We'll
|
||||
// remove it later if it's not needed
|
||||
all_same = false;
|
||||
} else {
|
||||
if let Some(&p_ssa) = blocks[p_idx].defs.borrow().get(&ssa) {
|
||||
if *pred_ssa.get_or_insert(p_ssa) != p_ssa {
|
||||
all_same = false;
|
||||
}
|
||||
} else {
|
||||
worklist.push(Reverse(p_idx));
|
||||
pushed_pred = true;
|
||||
} else if let Some(&p_ssa) = blocks[p_idx].defs.borrow().get(&ssa) {
|
||||
if *pred_ssa.get_or_insert(p_ssa) != p_ssa {
|
||||
all_same = false;
|
||||
}
|
||||
} else {
|
||||
worklist.push(Reverse(p_idx));
|
||||
pushed_pred = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue