summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_nir_to_llvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/vulkan/radv_nir_to_llvm.c')
-rw-r--r--src/amd/vulkan/radv_nir_to_llvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 298150b8092..8c316959280 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -3229,6 +3229,13 @@ static void ac_compile_llvm_module(LLVMTargetMachineRef tm,
ac_dump_module(llvm_module);
memset(binary, 0, sizeof(*binary));
+
+ if (options->record_llvm_ir) {
+ char *llvm_ir = LLVMPrintModuleToString(llvm_module);
+ binary->llvm_ir_string = strdup(llvm_ir);
+ LLVMDisposeMessage(llvm_ir);
+ }
+
int v = ac_llvm_compile(llvm_module, binary, tm);
if (v) {
fprintf(stderr, "compile failed\n");