radeonsi: raise the alignment of LDS memory for compute shaders
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 4 May 2019 10:37:36 +0000 (12:37 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 13 Jun 2019 00:28:23 +0000 (20:28 -0400)
This implies that the memory will always be at address 0, which allows
LLVM to generate slightly better code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 3617214ebef30e6d5fde8bc2fa7c93bdfb18bbd4..ed2db3d0042bad7f7129c6515fcbf49bb4db0ed6 100644 (file)
@@ -2217,7 +2217,7 @@ void si_declare_compute_memory(struct si_shader_context *ctx)
                                          LLVMArrayType(ctx->i8, lds_size),
                                          "compute_lds",
                                          AC_ADDR_SPACE_LDS);
-       LLVMSetAlignment(var, 4);
+       LLVMSetAlignment(var, 64 * 1024);
 
        ctx->ac.lds = LLVMBuildBitCast(ctx->ac.builder, var, i8p, "");
 }