[Mesa-dev] [PATCH 1/1] clover: Dump linked module to a different file

Jan Vesely jan.vesely at rutgers.edu
Wed Feb 22 15:51:26 UTC 2017


This allows to pass the generated files directly to llc or bugpoint.
Note that if program links multiple binaries they will still be in the same file, the module name is "link".

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index f63ff3d..7eecdca 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -282,7 +282,7 @@ clover::llvm::link_program(const std::vector<module> &modules,
    optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
 
    if (has_flag(debug::llvm))
-      debug::log(".ll", print_module_bitcode(*mod));
+      debug::log("." + mod->getModuleIdentifier() + ".ll", print_module_bitcode(*mod));
 
    if (create_library) {
       return build_module_library(*mod, module::section::text_library);
@@ -292,7 +292,7 @@ clover::llvm::link_program(const std::vector<module> &modules,
 
    } else if (ir == PIPE_SHADER_IR_NATIVE) {
       if (has_flag(debug::native))
-         debug::log(".asm", print_module_native(*mod, target));
+         debug::log("." + mod->getModuleIdentifier() +  ".asm", print_module_native(*mod, target));
 
       return build_module_native(*mod, target, *c, r_log);
 
-- 
2.9.3



More information about the mesa-dev mailing list