nak/legalize: Fold immediate sources before instructions
This way, if we insert a copy to move the immediate to a GPR, the
immediate we place in the copy is also folded.
Fixes: 85462f7455 ("nak: Legalize immediates with source modifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
This commit is contained in:
committed by
Marge Bot
parent
00c6244ca2
commit
37b55ee34f
@@ -815,6 +815,11 @@ fn legalize_instr(
|
||||
ip: usize,
|
||||
instr: &mut Instr,
|
||||
) {
|
||||
let src_types = instr.src_types();
|
||||
for (i, src) in instr.srcs_mut().iter_mut().enumerate() {
|
||||
*src = src.fold_imm(src_types[i]);
|
||||
}
|
||||
|
||||
if b.sm() >= 70 {
|
||||
legalize_sm70_instr(b, bl, ip, instr);
|
||||
} else if b.sm() >= 50 {
|
||||
@@ -823,11 +828,6 @@ fn legalize_instr(
|
||||
panic!("Unknown shader model SM{}", b.sm());
|
||||
}
|
||||
|
||||
let src_types = instr.src_types();
|
||||
for (i, src) in instr.srcs_mut().iter_mut().enumerate() {
|
||||
*src = src.fold_imm(src_types[i]);
|
||||
}
|
||||
|
||||
let mut vec_src_map: HashMap<SSARef, SSARef> = HashMap::new();
|
||||
let mut vec_comps = HashSet::new();
|
||||
for src in instr.srcs_mut() {
|
||||
|
||||
Reference in New Issue
Block a user