[Mesa-dev] [PATCH v2 6/6] nv50/ir: teach insnCanLoad() about SHLADD

Ilia Mirkin imirkin at alum.mit.edu
Mon Sep 26 21:16:26 UTC 2016


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Mon, Sep 26, 2016 at 5:02 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Commutativity is not allowed with SHLADD, but src2 can accept
> loads. To allow the load propagation pass to do its job, add a
> special case like for SUCLAMP because src1 is always an immediate.
>
> This IMAD to SHLADD optimization helps a bunch of shaders from Tomb
> Raider, Victor Vran, UE4 demos (+15% perf with Elemental) and Shadow
> Warrior.
>
> GF100/GK104:
>
> total instructions in shared programs :2838045 -> 2834712 (-0.12%)
> total gprs used in shared programs    :396684 -> 396386 (-0.08%)
> total local used in shared programs   :34416 -> 34416 (0.00%)
>
>                 local        gpr       inst      bytes
>     helped           0         326        1105        1105
>       hurt           0          55           3           3
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
> index d8fa285..9bc5b8d 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
> @@ -334,6 +334,8 @@ TargetNVC0::insnCanLoad(const Instruction *i, int s,
>        if (i->src(k).getFile() == FILE_IMMEDIATE) {
>           if (k == 2 && i->op == OP_SUCLAMP) // special case
>              continue;
> +         if (k == 1 && i->op == OP_SHLADD) // special case
> +            continue;
>           if (i->getSrc(k)->reg.data.u64 != 0)
>              return false;
>        } else
> --
> 2.10.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list