[Mesa-dev] [PATCH 07/19] radeonsi: use gallivm less

Marek Olšák maraeo at gmail.com
Fri Jun 22 22:31:58 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_shader.c     | 4 ++--
 src/gallium/drivers/radeonsi/si_shader_nir.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index bac79d7f999..9248c4c49b6 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5841,21 +5841,21 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
 
 	LLVMPositionBuilderAtEnd(builder, end_bb);
 
 	LLVMBuildRetVoid(ctx.ac.builder);
 
 	ctx.type = PIPE_SHADER_GEOMETRY; /* override for shader dumping */
 	si_llvm_optimize_module(&ctx);
 
 	r = si_compile_llvm(sscreen, &ctx.shader->binary,
 			    &ctx.shader->config, ctx.compiler,
-			    ctx.gallivm.module,
+			    ctx.ac.module,
 			    debug, PIPE_SHADER_GEOMETRY,
 			    "GS Copy Shader");
 	if (!r) {
 		if (si_can_dump_shader(sscreen, PIPE_SHADER_GEOMETRY))
 			fprintf(stderr, "GS Copy Shader:\n");
 		si_shader_dump(sscreen, ctx.shader, debug,
 			       PIPE_SHADER_GEOMETRY, stderr, true);
 		r = si_shader_binary_upload(sscreen, ctx.shader);
 	}
 
@@ -6984,21 +6984,21 @@ int si_compile_tgsi_shader(struct si_screen *sscreen,
 		ctx.shader->config.private_mem_vgprs =
 			ac_count_scratch_private_memory(ctx.main_fn);
 	}
 
 	/* Make sure the input is a pointer and not integer followed by inttoptr. */
 	assert(LLVMGetTypeKind(LLVMTypeOf(LLVMGetParam(ctx.main_fn, 0))) ==
 	       LLVMPointerTypeKind);
 
 	/* Compile to bytecode. */
 	r = si_compile_llvm(sscreen, &shader->binary, &shader->config, compiler,
-			    ctx.gallivm.module, debug, ctx.type, "TGSI shader");
+			    ctx.ac.module, debug, ctx.type, "TGSI shader");
 	si_llvm_dispose(&ctx);
 	if (r) {
 		fprintf(stderr, "LLVM failed to compile shader\n");
 		return r;
 	}
 
 	/* Validate SGPR and VGPR usage for compute to detect compiler bugs.
 	 * LLVM 3.9svn has this bug.
 	 */
 	if (sel->type == PIPE_SHADER_COMPUTE) {
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 288222cc86a..be64f2098eb 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -895,34 +895,34 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
 			     LLVMConstInt(ctx->ac.i32, base_index + constant_index, false),
 			     "");
 
 	if (image) {
 		assert(desc_type == AC_DESC_IMAGE || desc_type == AC_DESC_BUFFER);
 		assert(base_index + constant_index < ctx->num_images);
 
 		if (dynamic_index)
 			index = si_llvm_bound_index(ctx, index, ctx->num_images);
 
-		index = LLVMBuildSub(ctx->gallivm.builder,
+		index = LLVMBuildSub(ctx->ac.builder,
 				     LLVMConstInt(ctx->i32, SI_NUM_IMAGES - 1, 0),
 				     index, "");
 
 		/* TODO: be smarter about when we use dcc_off */
 		return si_load_image_desc(ctx, list, index, desc_type, write);
 	}
 
 	assert(base_index + constant_index < ctx->num_samplers);
 
 	if (dynamic_index)
 		index = si_llvm_bound_index(ctx, index, ctx->num_samplers);
 
-	index = LLVMBuildAdd(ctx->gallivm.builder, index,
+	index = LLVMBuildAdd(ctx->ac.builder, index,
 			     LLVMConstInt(ctx->i32, SI_NUM_IMAGES / 2, 0), "");
 
 	return si_load_sampler_desc(ctx, list, index, desc_type);
 }
 
 static void bitcast_inputs(struct si_shader_context *ctx,
 			   LLVMValueRef data[4],
 			   unsigned input_idx)
 {
 	for (unsigned chan = 0; chan < 4; chan++) {
-- 
2.17.1



More information about the mesa-dev mailing list