radeonsi: use ac.lds for shared memory
authorMarek Olšák <marek.olsak@amd.com>
Thu, 9 Nov 2017 22:34:26 +0000 (23:34 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 25 Nov 2017 16:16:56 +0000 (17:16 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_internal.h
src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c

index d7c130a706007692cd689af7b7d9551ed50300f1..bca0ca92248fe3c8e7d52cee41adb46f618e94c4 100644 (file)
@@ -1905,7 +1905,7 @@ void si_declare_compute_memory(struct si_shader_context *ctx,
 
        assert(decl->Declaration.MemType == TGSI_MEMORY_TYPE_SHARED);
        assert(decl->Range.First == decl->Range.Last);
-       assert(!ctx->shared_memory);
+       assert(!ctx->ac.lds);
 
        var = LLVMAddGlobalInAddressSpace(ctx->ac.module,
                                          LLVMArrayType(ctx->i8, sel->local_size),
@@ -1913,7 +1913,7 @@ void si_declare_compute_memory(struct si_shader_context *ctx,
                                          LOCAL_ADDR_SPACE);
        LLVMSetAlignment(var, 4);
 
-       ctx->shared_memory = LLVMBuildBitCast(ctx->ac.builder, var, i8p, "");
+       ctx->ac.lds = LLVMBuildBitCast(ctx->ac.builder, var, i8p, "");
 }
 
 static LLVMValueRef load_const_buffer_desc(struct si_shader_context *ctx, int i)
index ebe11fad56d51c14cac361a38b7eeed2da350c40..4bd128ef56c5d8fe344144953d6dd7277242d45c 100644 (file)
@@ -221,8 +221,6 @@ struct si_shader_context {
 
        LLVMValueRef i32_0;
        LLVMValueRef i32_1;
-
-       LLVMValueRef shared_memory;
 };
 
 static inline struct si_shader_context *
index ec11c75b888c9d9ae489940ec66591f72608f7f3..5552cc8c8bbeb0249f9f18c5f2bd72fc27b08f25 100644 (file)
@@ -449,7 +449,7 @@ static LLVMValueRef get_memory_ptr(struct si_shader_context *ctx,
        offset = lp_build_emit_fetch(&ctx->bld_base, inst, arg, 0);
        offset = ac_to_integer(&ctx->ac, offset);
 
-       ptr = ctx->shared_memory;
+       ptr = ctx->ac.lds;
        ptr = LLVMBuildGEP(builder, ptr, &offset, 1, "");
        addr_space = LLVMGetPointerAddressSpace(LLVMTypeOf(ptr));
        ptr = LLVMBuildBitCast(builder, ptr, LLVMPointerType(type, addr_space), "");