aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/radeon_llvm.h
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2016-05-17 18:10:51 +0000
committerTom Stellard <[email protected]>2016-07-06 19:47:38 +0000
commit513fccdfb68e6a71180e21827f071617c93fd09b (patch)
tree8534e8e42e1c0fb01c813f087056aef7338417b1 /src/gallium/drivers/radeon/radeon_llvm.h
parent02873a7b0c2cef5278f97b85d28fc578eb1de42f (diff)
radeon/llvm: Use alloca instructions for larger arrays
We were storing arrays in vectors, which was leading to some really bad spill code for large arrays. allocas instructions are a better fit for arrays and LLVM optimizations are more geared toward dealing with allocas instead of vectors. For arrays that have 16 or less 32-bit elements, we will continue to use vectors, because this will force LLVM to store them in registers and use indirect registers, which is usually faster for small arrays. In the future we should use allocas for all arrays and teach LLVM how to store allocas in registers. This fixes the piglit test: spec/glsl-1.50/execution/geometry/max-input-component Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/radeon_llvm.h')
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h
index 61afa7aa776..cc4bd5b7254 100644
--- a/src/gallium/drivers/radeon/radeon_llvm.h
+++ b/src/gallium/drivers/radeon/radeon_llvm.h
@@ -50,6 +50,11 @@ struct radeon_llvm_loop {
LLVMBasicBlockRef endloop_block;
};
+struct radeon_llvm_array {
+ struct tgsi_declaration_range range;
+ LLVMValueRef alloca;
+};
+
struct radeon_llvm_context {
struct lp_build_tgsi_soa_context soa;
@@ -96,7 +101,7 @@ struct radeon_llvm_context {
unsigned loop_depth;
unsigned loop_depth_max;
- struct tgsi_declaration_range *arrays;
+ struct radeon_llvm_array *arrays;
LLVMValueRef main_fn;
LLVMTypeRef return_type;