mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 12:00:12 +01:00
nak: Add a RegFileSet filter to NextUseLiveness::for_function()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
002ee9e40e
commit
72a4721412
1 changed files with 10 additions and 3 deletions
|
|
@ -455,18 +455,25 @@ pub struct NextUseLiveness {
|
|||
}
|
||||
|
||||
impl NextUseLiveness {
|
||||
pub fn for_function(func: &Function) -> NextUseLiveness {
|
||||
pub fn for_function(
|
||||
func: &Function,
|
||||
files: &RegFileSet,
|
||||
) -> NextUseLiveness {
|
||||
let mut blocks = Vec::new();
|
||||
for (bi, b) in func.blocks.iter().enumerate() {
|
||||
let mut bl = NextUseBlockLiveness::new(b.instrs.len());
|
||||
|
||||
for (ip, instr) in b.instrs.iter().enumerate() {
|
||||
instr.for_each_ssa_use(|ssa| {
|
||||
bl.add_use(*ssa, ip);
|
||||
if files.contains(ssa.file()) {
|
||||
bl.add_use(*ssa, ip);
|
||||
}
|
||||
});
|
||||
|
||||
instr.for_each_ssa_def(|ssa| {
|
||||
bl.add_def(*ssa);
|
||||
if files.contains(ssa.file()) {
|
||||
bl.add_def(*ssa);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue