[Mesa-dev] [PATCH 09/19] gallium/radeon: simplify radeon_llvm_emit_fetch for direct array addressing
Nicolai Hähnle
nhaehnle at gmail.com
Tue Aug 9 10:36:38 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
We can use the pointer stored in the temps array directly.
---
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
More information about the mesa-dev
mailing list