radeonsi: use ac.lds for shared memory

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2017-11-09 23:34:26 +01:00
parent 39b098dafb
commit b63e7d4c6f
3 changed files with 3 additions and 5 deletions

View 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->Declaration.MemType == TGSI_MEMORY_TYPE_SHARED);
assert(decl->Range.First == decl->Range.Last); assert(decl->Range.First == decl->Range.Last);
assert(!ctx->shared_memory); assert(!ctx->ac.lds);
var = LLVMAddGlobalInAddressSpace(ctx->ac.module, var = LLVMAddGlobalInAddressSpace(ctx->ac.module,
LLVMArrayType(ctx->i8, sel->local_size), LLVMArrayType(ctx->i8, sel->local_size),
@ -1913,7 +1913,7 @@ void si_declare_compute_memory(struct si_shader_context *ctx,
LOCAL_ADDR_SPACE); LOCAL_ADDR_SPACE);
LLVMSetAlignment(var, 4); 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) static LLVMValueRef load_const_buffer_desc(struct si_shader_context *ctx, int i)

View File

@ -221,8 +221,6 @@ struct si_shader_context {
LLVMValueRef i32_0; LLVMValueRef i32_0;
LLVMValueRef i32_1; LLVMValueRef i32_1;
LLVMValueRef shared_memory;
}; };
static inline struct si_shader_context * static inline struct si_shader_context *

View 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 = lp_build_emit_fetch(&ctx->bld_base, inst, arg, 0);
offset = ac_to_integer(&ctx->ac, offset); offset = ac_to_integer(&ctx->ac, offset);
ptr = ctx->shared_memory; ptr = ctx->ac.lds;
ptr = LLVMBuildGEP(builder, ptr, &offset, 1, ""); ptr = LLVMBuildGEP(builder, ptr, &offset, 1, "");
addr_space = LLVMGetPointerAddressSpace(LLVMTypeOf(ptr)); addr_space = LLVMGetPointerAddressSpace(LLVMTypeOf(ptr));
ptr = LLVMBuildBitCast(builder, ptr, LLVMPointerType(type, addr_space), ""); ptr = LLVMBuildBitCast(builder, ptr, LLVMPointerType(type, addr_space), "");