[Mesa-dev] [PATCH 0/2] i965/vec4: Change SEL and MOV types as needed to propagate source modifiers

Jason Ekstrand jason at jlekstrand.net
Wed Sep 16 15:32:17 PDT 2015


On Wed, Sep 16, 2015 at 12:47 PM, Alejandro Piñeiro
<apinheiro at igalia.com> wrote:
> On the review of the patch "i965/nir/vec4: fill the type of the dst
> and src when loading an uniform" Jason Ekstrand suggested to change
> the optimization pass in order to allow the copy propagation with
> MOVs even if there is a type mismatch, as was done on the fs path,
> instead of fixing the type for MOV instructions.[1]
>
> So using commit 472ef9 as reference I implemented the equivalent
> for the vec4 case. But that only worked if it was the current
> instruction the MOV with default types. It didn't fixed the shader-db
> instruction count regression I was working on, that was when it was
> the from instruction the MOV with default types. Or in other words,
> it didn't cover this case:
>
>    1: mov vgrf1.0:UD, u0.xyzw:UD
>    2: add vgrf2.0:F, vgrf0.xyzw:F, -vgrf1.xyzw:F
>
> So I extended the same idea by checking too against the from
> instruction. In order to do that, I needed to also track
> the vec4_instructions on the copy_entry struct.
>
> Submitting two patches because I think that it will be easier
> to review in this way. But if this solutions is approved, I
> think that it could be better to push them squashed on just
> one patch.

I don't know that I care that much about squashing them or not.  I
reviewed the first one but I'm confused about what's going on in the
second.
--Jason

> Shader-db results for vec4 programs on Haswell:
> total instructions in shared programs: 1746280 -> 1732159 (-0.81%)
> instructions in affected programs:     760595 -> 746474 (-1.86%)
> helped:                                6132
> HURT:                                  0
> GAINED:                                0
> LOST:                                  0
>
>
> [1] http://lists.freedesktop.org/archives/mesa-dev/2015-September/094555.html
>
> Alejandro Piñeiro (2):
>   i965/vec4: Change types as needed to propagate source modifiers using
>     current instruction
>   i965/vec4: Change types as needed to propagate source modifiers using
>     from instruction
>
>  .../drivers/dri/i965/brw_vec4_copy_propagation.cpp | 45 ++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 4 deletions(-)
>
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list