summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-01-19 12:12:02 +0100
committerSamuel Pitoiset <[email protected]>2018-01-22 12:28:33 +0100
commit33e6e5e6a45a63728053d92c366fe8b320199843 (patch)
treea5dd61a31210be3d044712e50db41daba522aea6 /src/amd/common
parent525b4f7548462bfc2e82f2d1f04f61ce6854a3c5 (diff)
radv: add an option that allows to dump pre-optimization ir
With RADV_DEBUG=preoptir. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c3
-rw-r--r--src/amd/common/ac_nir_to_llvm.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 2aef51be855..3d9cb249ad6 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -6848,6 +6848,9 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
LLVMBuildRetVoid(ctx.builder);
+ if (options->dump_preoptir)
+ ac_dump_module(ctx.module);
+
ac_llvm_finalize_module(&ctx);
if (shader_count == 1)
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 1737866166e..62ea38be373 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -81,6 +81,7 @@ struct ac_nir_compiler_options {
bool unsafe_math;
bool supports_spill;
bool clamp_shadow_reference;
+ bool dump_preoptir;
enum radeon_family family;
enum chip_class chip_class;
};