[Mesa-dev] [PATCH] i965: Handle CMP.nz ... 0 and MOV.nz similarly in cmod propagation.

Matt Turner mattst88 at gmail.com
Mon Jan 26 10:08:27 PST 2015


On Sat, Jan 24, 2015 at 4:16 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> "MOV.nz null src" and "CMP.nz null src 0" are equivalent instructions.
>
> Previously, we deleted MOV.nz instructions when the instruction
> generating the MOV's source also wrote the flag register (as the flag
> register already contains the desired value).  However, we wouldn't
> delete CMP.nz instructions that served the same purpose.
>
> We also didn't attempt true cmod propagation on MOV.nz instructions,
> while we would for the equivalent CMP.nz form.
>
> This patch fixes both limitations, treating both forms equally.
> CMP.nz instructions will now be deleted (helping the NIR backend),
> and MOV.nz instructions will have their .nz propagated.
>
> No changes in shader-db without NIR.  With NIR,
>
> total instructions in shared programs: 6006153 -> 5969364 (-0.61%)
> instructions in affected programs:     2087139 -> 2050350 (-1.76%)
> helped:                                10704
> HURT:                                  0
> GAINED:                                2
> LOST:                                  2

Nice. Thanks!

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list