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>
This commit is contained in:
Mel Henning 2025-02-05 18:38:42 -05:00 committed by Marge Bot
parent 2fa557d29d
commit 48edb9cec2

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"),
};
};