diff options
author | Samuel Pitoiset <[email protected]> | 2018-03-01 22:12:55 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-03-06 10:38:40 +0100 |
commit | 7f6b91c9c36354b5478e86494d3ebae689f1b509 (patch) | |
tree | 42b37b64079f0609583fbcc5e115a1f5ca612a9a /src | |
parent | 3b8e7459f2db084f46a0a064675cb226c372c037 (diff) |
ac/nir: count the scratch private memory size
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 10 | ||||
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 39d92ca0e0a..ea51c3a54a9 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -6800,7 +6800,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, struct nir_shader *const *shaders, int shader_count, struct ac_shader_variant_info *shader_info, - const struct ac_nir_compiler_options *options) + const struct ac_nir_compiler_options *options, + bool dump_shader) { struct radv_shader_context ctx = {0}; unsigned i; @@ -6967,6 +6968,11 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, if (shader_count == 1) ac_nir_eliminate_const_vs_outputs(&ctx); + if (dump_shader) { + ctx.shader_info->private_mem_vgprs = + ac_count_scratch_private_memory(ctx.main_function); + } + return ctx.ac.module; } @@ -7160,7 +7166,7 @@ void ac_compile_nir_shader(LLVMTargetMachineRef tm, { LLVMModuleRef llvm_module = ac_translate_nir_to_llvm(tm, nir, nir_count, shader_info, - options); + options, dump_shader); ac_compile_llvm_module(tm, llvm_module, binary, config, shader_info, nir[0]->info.stage, dump_shader, options->supports_spill); for (int i = 0; i < nir_count; ++i) diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h index eea393a9c24..870e7f8988c 100644 --- a/src/amd/common/ac_nir_to_llvm.h +++ b/src/amd/common/ac_nir_to_llvm.h @@ -163,6 +163,7 @@ struct ac_shader_variant_info { unsigned num_user_sgprs; unsigned num_input_sgprs; unsigned num_input_vgprs; + unsigned private_mem_vgprs; bool need_indirect_descriptor_sets; struct { struct { |