nak/opt_copy_prop: Force alu src for IAdd2X/IAdd3X

Cc: mesa-stable
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Faith Ekstrand <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33420>
(cherry picked from commit 48edb9cec2)
This commit is contained in:
Mel Henning 2025-02-05 18:38:42 -05:00 committed by Eric Engestrom
parent ea52e480cb
commit 92e02eebea
2 changed files with 7 additions and 3 deletions

View file

@ -174,7 +174,7 @@
"description": "nak/opt_copy_prop: Force alu src for IAdd2X/IAdd3X",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -643,9 +643,13 @@ impl CopyPropPass {
// written.
let force_alu_src_type = match &instr.op {
Op::IAdd2(add) => !add.carry_out.is_none(),
Op::IAdd2X(add) => !add.carry_out.is_none(),
Op::IAdd3(add) => {
!add.overflow[0].is_none() || !add.overflow[1].is_none()
}
Op::IAdd3X(add) => {
!add.overflow[0].is_none() || !add.overflow[1].is_none()
}
_ => false,
};
@ -654,8 +658,8 @@ impl CopyPropPass {
let mut src_type = src_types[i];
if force_alu_src_type {
src_type = match src_type {
SrcType::I32 => SrcType::ALU,
SrcType::Pred => SrcType::Pred,
SrcType::B32 | SrcType::I32 => SrcType::ALU,
SrcType::Carry | SrcType::Pred => src_type,
_ => panic!("Unhandled src_type"),
};
};