broadcom/compiler: return early for SFU op latency calculation

Since we are returning a fixed latency for these check for them
earlier and return early if they match.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22675>
This commit is contained in:
Iago Toral Quiroga 2023-04-25 09:32:27 +02:00
parent 148473eae4
commit c2003535b9

View file

@ -1460,6 +1460,9 @@ instruction_latency(const struct v3d_device_info *devinfo,
after_inst->type != V3D_QPU_INSTR_TYPE_ALU)
return latency;
if (v3d_qpu_instr_is_sfu(before_inst))
return 2;
if (before_inst->alu.add.op != V3D_QPU_A_NOP &&
before_inst->alu.add.magic_write) {
latency = MAX2(latency,
@ -1476,9 +1479,6 @@ instruction_latency(const struct v3d_device_info *devinfo,
after_inst));
}
if (v3d_qpu_instr_is_sfu(before_inst))
return 2;
return latency;
}