[Mesa-dev] [PATCH] radv: include LLVM IR in the VK_AMD_shader_info "disassembly"

Nicolai Hähnle nhaehnle at gmail.com
Thu Nov 8 15:15:01 UTC 2018


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Helpful for debugging compiler backend problems: this allows us to
easily retrieve the LLVM IR from RenderDoc.
--
For the peanut gallery: AMD's official stance on radv hasn't changed.
But we take regressions for radv caused by our changes in LLVM seriously.
After all, they might just as well affect anything else using the same
compiler backend...
---
 src/amd/vulkan/radv_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index f98ca6b4edd..1c51297d202 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -855,20 +855,21 @@ radv_GetShaderInfoAMD(VkDevice _device,
 				result = VK_INCOMPLETE;
 		}
 
 		break;
 	case VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD:
 		buf = _mesa_string_buffer_create(NULL, 1024);
 
 		_mesa_string_buffer_printf(buf, "%s:\n", radv_get_shader_name(variant, stage));
 		_mesa_string_buffer_printf(buf, "%s\n\n", variant->disasm_string);
 		generate_shader_stats(device, variant, stage, buf);
+		_mesa_string_buffer_printf(buf, "\n\n%s\n\n", variant->llvm_ir_string);
 
 		/* Need to include the null terminator. */
 		size_t length = buf->length + 1;
 
 		if (!pInfo) {
 			*pInfoSize = length;
 		} else {
 			size_t size = *pInfoSize;
 			*pInfoSize = length;
 
-- 
2.19.1



More information about the mesa-dev mailing list