aco,radv: rename record_llvm_ir/llvm_ir_string to record_ir/ir_string

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Rhys Perry 2019-09-25 11:48:04 +01:00
parent ec8ced9123
commit 3c966fd688
6 changed files with 18 additions and 18 deletions

View File

@ -96,7 +96,7 @@ void aco_compile_shader(unsigned shader_count,
aco::schedule_program(program.get(), live_vars); aco::schedule_program(program.get(), live_vars);
std::string llvm_ir; std::string llvm_ir;
if (options->record_llvm_ir) { if (options->record_ir) {
char *data = NULL; char *data = NULL;
size_t size = 0; size_t size = 0;
FILE *f = open_memstream(&data, &size); FILE *f = open_memstream(&data, &size);
@ -140,7 +140,7 @@ void aco_compile_shader(unsigned shader_count,
std::vector<uint32_t> code; std::vector<uint32_t> code;
unsigned exec_size = aco::emit_program(program.get(), code); unsigned exec_size = aco::emit_program(program.get(), code);
bool get_disasm = options->dump_shader || options->record_llvm_ir; bool get_disasm = options->dump_shader || options->record_ir;
size_t size = llvm_ir.size(); size_t size = llvm_ir.size();
@ -167,7 +167,7 @@ void aco_compile_shader(unsigned shader_count,
legacy_binary->config = config; legacy_binary->config = config;
legacy_binary->disasm_size = 0; legacy_binary->disasm_size = 0;
legacy_binary->llvm_ir_size = llvm_ir.size(); legacy_binary->ir_size = llvm_ir.size();
llvm_ir.copy((char*) legacy_binary->data + legacy_binary->code_size, llvm_ir.size()); llvm_ir.copy((char*) legacy_binary->data + legacy_binary->code_size, llvm_ir.size());

View File

@ -507,7 +507,7 @@ radv_dump_shader(struct radv_pipeline *pipeline,
fprintf(f, "NIR:\n%s\n", shader->nir_string); fprintf(f, "NIR:\n%s\n", shader->nir_string);
} }
fprintf(f, "LLVM IR:\n%s\n", shader->llvm_ir_string); fprintf(f, "LLVM IR:\n%s\n", shader->ir_string);
fprintf(f, "DISASM:\n%s\n", shader->disasm_string); fprintf(f, "DISASM:\n%s\n", shader->disasm_string);
radv_shader_dump_stats(pipeline->device, shader, stage, f); radv_shader_dump_stats(pipeline->device, shader, stage, f);

View File

@ -4986,7 +4986,7 @@ static void ac_compile_llvm_module(struct ac_llvm_compiler *ac_llvm,
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
if (options->record_llvm_ir) { if (options->record_ir) {
char *llvm_ir = LLVMPrintModuleToString(llvm_module); char *llvm_ir = LLVMPrintModuleToString(llvm_module);
llvm_ir_string = strdup(llvm_ir); llvm_ir_string = strdup(llvm_ir);
LLVMDisposeMessage(llvm_ir); LLVMDisposeMessage(llvm_ir);

View File

@ -5241,7 +5241,7 @@ VkResult radv_GetPipelineExecutableInternalRepresentationsKHR(
} }
++p; ++p;
/* LLVM IR */ /* backend IR */
if (p < end) { if (p < end) {
p->isText = true; p->isText = true;
if (shader->aco_used) { if (shader->aco_used) {
@ -5251,7 +5251,7 @@ VkResult radv_GetPipelineExecutableInternalRepresentationsKHR(
desc_copy(p->name, "LLVM IR"); desc_copy(p->name, "LLVM IR");
desc_copy(p->description, "The LLVM IR after some optimizations"); desc_copy(p->description, "The LLVM IR after some optimizations");
} }
if (radv_copy_representation(p->pData, &p->dataSize, shader->llvm_ir_string) != VK_SUCCESS) if (radv_copy_representation(p->pData, &p->dataSize, shader->ir_string) != VK_SUCCESS)
result = VK_INCOMPLETE; result = VK_INCOMPLETE;
} }
++p; ++p;

View File

@ -1032,7 +1032,7 @@ radv_shader_variant_create(struct radv_device *device,
return NULL; return NULL;
} }
variant->llvm_ir_string = bin->llvm_ir_size ? strdup((const char*)(bin->data + bin->elf_size)) : NULL; variant->ir_string = bin->llvm_ir_size ? strdup((const char*)(bin->data + bin->elf_size)) : NULL;
variant->disasm_string = malloc(disasm_size + 1); variant->disasm_string = malloc(disasm_size + 1);
memcpy(variant->disasm_string, disasm_data, disasm_size); memcpy(variant->disasm_string, disasm_data, disasm_size);
variant->disasm_string[disasm_size] = 0; variant->disasm_string[disasm_size] = 0;
@ -1048,8 +1048,8 @@ radv_shader_variant_create(struct radv_device *device,
for (unsigned i = 0; i < DEBUGGER_NUM_MARKERS; i++) for (unsigned i = 0; i < DEBUGGER_NUM_MARKERS; i++)
ptr32[i] = DEBUGGER_END_OF_CODE_MARKER; ptr32[i] = DEBUGGER_END_OF_CODE_MARKER;
variant->llvm_ir_string = bin->llvm_ir_size ? strdup((const char*)(bin->data + bin->code_size)) : NULL; variant->ir_string = bin->ir_size ? strdup((const char*)(bin->data + bin->code_size)) : NULL;
variant->disasm_string = bin->disasm_size ? strdup((const char*)(bin->data + bin->code_size + bin->llvm_ir_size)) : NULL; variant->disasm_string = bin->disasm_size ? strdup((const char*)(bin->data + bin->code_size + bin->ir_size)) : NULL;
} }
return variant; return variant;
} }
@ -1098,7 +1098,7 @@ shader_variant_compile(struct radv_device *device,
options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader); options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader);
options->dump_preoptir = options->dump_shader && options->dump_preoptir = options->dump_shader &&
device->instance->debug_flags & RADV_DEBUG_PREOPTIR; device->instance->debug_flags & RADV_DEBUG_PREOPTIR;
options->record_llvm_ir = keep_shader_info; options->record_ir = keep_shader_info;
options->check_ir = device->instance->debug_flags & RADV_DEBUG_CHECKIR; options->check_ir = device->instance->debug_flags & RADV_DEBUG_CHECKIR;
options->tess_offchip_block_dw_size = device->tess_offchip_block_dw_size; options->tess_offchip_block_dw_size = device->tess_offchip_block_dw_size;
options->address32_hi = device->physical_device->rad_info.address32_hi; options->address32_hi = device->physical_device->rad_info.address32_hi;
@ -1115,7 +1115,7 @@ shader_variant_compile(struct radv_device *device,
else else
options->wave_size = device->physical_device->ge_wave_size; options->wave_size = device->physical_device->ge_wave_size;
if (!use_aco || options->dump_shader || options->record_llvm_ir) if (!use_aco || options->dump_shader || options->record_ir)
ac_init_llvm_once(); ac_init_llvm_once();
if (use_aco) { if (use_aco) {
@ -1238,7 +1238,7 @@ radv_shader_variant_destroy(struct radv_device *device,
free(variant->nir_string); free(variant->nir_string);
free(variant->disasm_string); free(variant->disasm_string);
free(variant->llvm_ir_string); free(variant->ir_string);
free(variant); free(variant);
} }
@ -1459,7 +1459,7 @@ radv_GetShaderInfoAMD(VkDevice _device,
buf = _mesa_string_buffer_create(NULL, 1024); buf = _mesa_string_buffer_create(NULL, 1024);
_mesa_string_buffer_printf(buf, "%s:\n", radv_get_shader_name(&variant->info, stage)); _mesa_string_buffer_printf(buf, "%s:\n", radv_get_shader_name(&variant->info, stage));
_mesa_string_buffer_printf(buf, "%s\n\n", variant->llvm_ir_string); _mesa_string_buffer_printf(buf, "%s\n\n", variant->ir_string);
_mesa_string_buffer_printf(buf, "%s\n\n", variant->disasm_string); _mesa_string_buffer_printf(buf, "%s\n\n", variant->disasm_string);
generate_shader_stats(device, variant, stage, buf); generate_shader_stats(device, variant, stage, buf);

View File

@ -123,7 +123,7 @@ struct radv_nir_compiler_options {
bool robust_buffer_access; bool robust_buffer_access;
bool dump_shader; bool dump_shader;
bool dump_preoptir; bool dump_preoptir;
bool record_llvm_ir; bool record_ir;
bool check_ir; bool check_ir;
bool has_ls_vgpr_init_bug; bool has_ls_vgpr_init_bug;
bool use_ngg_streamout; bool use_ngg_streamout;
@ -334,10 +334,10 @@ struct radv_shader_binary_legacy {
struct ac_shader_config config; struct ac_shader_config config;
unsigned code_size; unsigned code_size;
unsigned exec_size; unsigned exec_size;
unsigned llvm_ir_size; unsigned ir_size;
unsigned disasm_size; unsigned disasm_size;
/* data has size of code_size + llvm_ir_size + disasm_size + 2, where /* data has size of code_size + ir_size + disasm_size + 2, where
* the +2 is for 0 of the ir strings. */ * the +2 is for 0 of the ir strings. */
uint8_t data[0]; uint8_t data[0];
}; };
@ -365,7 +365,7 @@ struct radv_shader_variant {
uint32_t spirv_size; uint32_t spirv_size;
char *nir_string; char *nir_string;
char *disasm_string; char *disasm_string;
char *llvm_ir_string; char *ir_string;
struct list_head slab_list; struct list_head slab_list;
}; };