[Mesa-dev] [PATCH 2/3] nvc0/ir: remove useless NVC0LoweringPass::gMemBase

Ilia Mirkin imirkin at alum.mit.edu
Wed Oct 19 21:29:53 UTC 2016


It avoids creating a ton of symbols unnecessarily during the lifetime
of the pass. Does it hurt anything?

On Wed, Oct 19, 2016 at 5:21 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> index caa571f..08b3a28 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -598,7 +598,6 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
>  NVC0LoweringPass::NVC0LoweringPass(Program *prog) : targ(prog->getTarget())
>  {
>     bld.setProgram(prog);
> -   gMemBase = NULL;
>  }
>
>  bool
> @@ -1980,9 +1979,7 @@ NVC0LoweringPass::handleSurfaceOpNVE4(TexInstruction *su)
>        }
>        Instruction *red = bld.mkOp(OP_ATOM, su->dType, bld.getSSA());
>        red->subOp = su->subOp;
> -      if (!gMemBase)
> -         gMemBase = bld.mkSymbol(FILE_MEMORY_GLOBAL, 0, TYPE_U32, 0);
> -      red->setSrc(0, gMemBase);
> +      red->setSrc(0, bld.mkSymbol(FILE_MEMORY_GLOBAL, 0, TYPE_U32, 0));
>        red->setSrc(1, su->getSrc(3));
>        if (su->subOp == NV50_IR_SUBOP_ATOM_CAS)
>           red->setSrc(2, su->getSrc(4));
> --
> 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