[Mesa-dev] [PATCH 09/19] gallium/radeon: simplify radeon_llvm_emit_fetch for direct array addressing

Tom Stellard tom at stellard.net
Wed Aug 10 16:12:37 UTC 2016


On Tue, Aug 09, 2016 at 12:36:38PM +0200, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 
> We can use the pointer stored in the temps array directly.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> ---
>  src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> index 41f24d3..e084248 100644
> --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> @@ -352,25 +352,20 @@ LLVMValueRef radeon_llvm_emit_fetch(struct lp_build_tgsi_context *bld_base,
>  	case TGSI_FILE_TEMPORARY:
>  		if (reg->Register.Index >= ctx->temps_count)
>  			return LLVMGetUndef(tgsi2llvmtype(bld_base, type));
>  		ptr = ctx->temps[reg->Register.Index * TGSI_NUM_CHANNELS + swizzle];
>  		if (tgsi_type_is_64bit(type)) {
>  			ptr2 = ctx->temps[reg->Register.Index * TGSI_NUM_CHANNELS + swizzle + 1];
>  			return radeon_llvm_emit_fetch_64bit(bld_base, type,
>  						 LLVMBuildLoad(builder, ptr, ""),
>  						 LLVMBuildLoad(builder, ptr2, ""));
>  		}
> -		LLVMValueRef array = get_alloca_for_array(bld_base, reg->Register.File, reg->Register.Index);
> -		if (array) {
> -			return bitcast(bld_base, type, load_value_from_array(bld_base, reg->Register.File, type,
> -					swizzle, reg->Register.Index, NULL));
> -		}
>  		result = LLVMBuildLoad(builder, ptr, "");
>  		break;
>  
>  	case TGSI_FILE_OUTPUT:
>  		ptr = lp_get_output_ptr(bld, reg->Register.Index, swizzle);
>  		if (tgsi_type_is_64bit(type)) {
>  			ptr2 = lp_get_output_ptr(bld, reg->Register.Index, swizzle + 1);
>  			return radeon_llvm_emit_fetch_64bit(bld_base, type,
>  						 LLVMBuildLoad(builder, ptr, ""),
>  						 LLVMBuildLoad(builder, ptr2, ""));
> -- 
> 2.7.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list