r300: there is no limitation on presubtract source file
authorPavel Ondračka <pavel.ondracka@gmail.com>
Tue, 22 Aug 2023 14:25:10 +0000 (16:25 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Aug 2023 14:48:15 +0000 (14:48 +0000)
RV530 shader-db:
total instructions in shared programs: 128840 -> 128803 (-0.03%)
instructions in affected programs: 1085 -> 1048 (-3.41%)
helped: 37
HURT: 1
total presub in shared programs: 7670 -> 7751 (1.06%)
presub in affected programs: 328 -> 409 (24.70%)
helped: 0
HURT: 81
total temps in shared programs: 16926 -> 16939 (0.08%)
temps in affected programs: 182 -> 195 (7.14%)
helped: 6
HURT: 19
total cycles in shared programs: 193751 -> 193729 (-0.01%)
cycles in affected programs: 3088 -> 3066 (-0.71%)
helped: 33
HURT: 5

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>

src/gallium/drivers/r300/compiler/radeon_optimize.c

index 6623468..fc475f1 100644 (file)
@@ -625,8 +625,6 @@ static int peephole_add_presub_inv(
        if ((inst_add->U.I.SrcReg[1].Negate & inst_add->U.I.DstReg.WriteMask) !=
                                                inst_add->U.I.DstReg.WriteMask
                || inst_add->U.I.SrcReg[1].Abs
-               || (inst_add->U.I.SrcReg[1].File != RC_FILE_TEMPORARY
-                       && inst_add->U.I.SrcReg[1].File != RC_FILE_CONSTANT)
                || src_has_const_swz(inst_add->U.I.SrcReg[1])) {
 
                return 0;