[Mesa-dev] [PATCH] nvc0/ir: fix shared atomic lowering to preserve shared memory location

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 17 07:39:53 UTC 2016


Good catch! Thanks.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Cc: mesa-stable at lists.freedesktop.org

On 05/17/2016 09:27 AM, Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  .../drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp  | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 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 1a45993..a1823a0 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -1129,8 +1129,8 @@ NVC0LoweringPass::handleSharedATOMNVE4(Instruction *atom)
>     bld.setPosition(tryLockBB, true);
>
>     Instruction *ld =
> -      bld.mkLoad(TYPE_U32, atom->getDef(0),
> -                 bld.mkSymbol(FILE_MEMORY_SHARED, 0, TYPE_U32, 0), NULL);
> +      bld.mkLoad(TYPE_U32, atom->getDef(0), atom->getSrc(0)->asSym(),
> +                 atom->getIndirect(0, 0));
>     ld->setDef(1, bld.getSSA(1, FILE_PREDICATE));
>     ld->subOp = NV50_IR_SUBOP_LOAD_LOCKED;
>
> @@ -1186,9 +1186,8 @@ NVC0LoweringPass::handleSharedATOMNVE4(Instruction *atom)
>     }
>
>     Instruction *st =
> -      bld.mkStore(OP_STORE, TYPE_U32,
> -                  bld.mkSymbol(FILE_MEMORY_SHARED, 0, TYPE_U32, 0),
> -                  NULL, stVal);
> +      bld.mkStore(OP_STORE, TYPE_U32, atom->getSrc(0)->asSym(),
> +                  atom->getIndirect(0, 0), stVal);
>     st->setDef(0, pred->getDef(0));
>     st->subOp = NV50_IR_SUBOP_STORE_UNLOCKED;
>
> @@ -1225,8 +1224,8 @@ NVC0LoweringPass::handleSharedATOM(Instruction *atom)
>     bld.setPosition(tryLockAndSetBB, true);
>
>     Instruction *ld =
> -      bld.mkLoad(TYPE_U32, atom->getDef(0),
> -                 bld.mkSymbol(FILE_MEMORY_SHARED, 0, TYPE_U32, 0), NULL);
> +      bld.mkLoad(TYPE_U32, atom->getDef(0), atom->getSrc(0)->asSym(),
> +                 atom->getIndirect(0, 0));
>     ld->setDef(1, bld.getSSA(1, FILE_PREDICATE));
>     ld->subOp = NV50_IR_SUBOP_LOAD_LOCKED;
>
> @@ -1283,9 +1282,8 @@ NVC0LoweringPass::handleSharedATOM(Instruction *atom)
>     }
>
>     Instruction *st =
> -      bld.mkStore(OP_STORE, TYPE_U32,
> -                  bld.mkSymbol(FILE_MEMORY_SHARED, 0, TYPE_U32, 0),
> -                  NULL, stVal);
> +      bld.mkStore(OP_STORE, TYPE_U32, atom->getSrc(0)->asSym(),
> +                  atom->getIndirect(0, 0), stVal);
>     st->setPredicate(CC_P, ld->getDef(1));
>     st->subOp = NV50_IR_SUBOP_STORE_UNLOCKED;
>
>


More information about the mesa-dev mailing list