Mesa (master): ac: remove the remaining duplicate llvm types

Timothy Arceri tarceri at kemper.freedesktop.org
Fri Nov 3 04:08:06 UTC 2017


Module: Mesa
Branch: master
Commit: 6e2eb96b6442f9f0660685af4172ab947c16e7c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e2eb96b6442f9f0660685af4172ab947c16e7c4

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Thu Nov  2 13:37:46 2017 +1100

ac: remove the remaining duplicate llvm types

Reviewed-by: Marek Olšák <marek.olsak at amd.com
Acked-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/amd/common/ac_nir_to_llvm.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index ec51ed7007..38a65b9cd1 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -134,8 +134,6 @@ struct nir_to_llvm_context {
 	LLVMValueRef persp_sample, persp_center, persp_centroid;
 	LLVMValueRef linear_sample, linear_center, linear_centroid;
 
-	unsigned uniform_md_kind;
-	LLVMValueRef empty_md;
 	gl_shader_stage stage;
 
 	LLVMValueRef inputs[RADEON_LLVM_MAX_INPUTS * 4];
@@ -980,13 +978,6 @@ static void create_function(struct nir_to_llvm_context *ctx,
 	ctx->shader_info->num_user_sgprs = user_sgpr_idx;
 }
 
-static void setup_types(struct nir_to_llvm_context *ctx)
-{
-	ctx->uniform_md_kind =
-	    LLVMGetMDKindIDInContext(ctx->context, "amdgpu.uniform", 14);
-	ctx->empty_md = LLVMMDNodeInContext(ctx->context, NULL, 0);
-}
-
 static int get_llvm_num_components(LLVMValueRef value)
 {
 	LLVMTypeRef type = LLVMTypeOf(value);
@@ -2220,7 +2211,7 @@ static LLVMValueRef visit_vulkan_resource_index(struct nir_to_llvm_context *ctx,
 	
 	desc_ptr = ac_build_gep0(&ctx->ac, desc_ptr, offset);
 	desc_ptr = cast_ptr(ctx, desc_ptr, ctx->ac.v4i32);
-	LLVMSetMetadata(desc_ptr, ctx->uniform_md_kind, ctx->empty_md);
+	LLVMSetMetadata(desc_ptr, ctx->ac.uniform_md_kind, ctx->ac.empty_md);
 
 	return LLVMBuildLoad(ctx->builder, desc_ptr, "");
 }
@@ -6481,7 +6472,6 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
 	LLVMDisposeTargetData(data_layout);
 	LLVMDisposeMessage(data_layout_str);
 
-	setup_types(&ctx);
 	ctx.builder = LLVMCreateBuilderInContext(ctx.context);
 	ctx.ac.builder = ctx.builder;
 
@@ -6854,7 +6844,6 @@ void ac_create_gs_copy_shader(LLVMTargetMachineRef tm,
 
 	ctx.is_gs_copy_shader = true;
 	LLVMSetTarget(ctx.module, "amdgcn--");
-	setup_types(&ctx);
 
 	ctx.builder = LLVMCreateBuilderInContext(ctx.context);
 	ctx.ac.builder = ctx.builder;




More information about the mesa-commit mailing list