mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
nak: Don't allocate bitsets in liveness data-flow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
04658a2a11
commit
827dba398d
2 changed files with 14 additions and 3 deletions
|
|
@ -497,6 +497,10 @@ impl SSAValueAllocator {
|
|||
SSAValueAllocator { count: 0 }
|
||||
}
|
||||
|
||||
pub fn max_idx(&self) -> u32 {
|
||||
self.count
|
||||
}
|
||||
|
||||
pub fn alloc(&mut self, file: RegFile) -> SSAValue {
|
||||
self.count += 1;
|
||||
SSAValue::new(file, self.count)
|
||||
|
|
|
|||
|
|
@ -311,6 +311,10 @@ impl SimpleLiveness {
|
|||
assert!(l.blocks.len() == func.blocks.len());
|
||||
assert!(live_in.len() == func.blocks.len());
|
||||
|
||||
let num_ssa = usize::try_from(func.ssa_alloc.max_idx() + 1).unwrap();
|
||||
let mut tmp = BitSet::new();
|
||||
tmp.reserve(num_ssa);
|
||||
|
||||
let mut to_do = true;
|
||||
while to_do {
|
||||
to_do = false;
|
||||
|
|
@ -320,10 +324,13 @@ impl SimpleLiveness {
|
|||
to_do |= bl.live_out.union_with(&live_in[*sb_idx]);
|
||||
}
|
||||
|
||||
let new_live_in =
|
||||
(bl.live_out.clone() | bl.uses.clone()) & !bl.defs.clone();
|
||||
tmp.clear();
|
||||
tmp.set_words(0..num_ssa, |w| {
|
||||
(bl.live_out.get_word(w) | bl.uses.get_word(w))
|
||||
& !bl.defs.get_word(w)
|
||||
});
|
||||
|
||||
to_do |= live_in[b_idx].union_with(&new_live_in);
|
||||
to_do |= live_in[b_idx].union_with(&tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue