summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2017-02-13 15:46:03 -0500
committerJan Vesely <[email protected]>2017-02-27 16:11:48 -0500
commit010fecb8536abd5e806206ceafca79bb71cff69f (patch)
tree772375b487b26ceb2e22c27b9a2cf3c5ea396e47 /src/gallium/state_trackers
parent800b82ea1315d68fccd8b1f218d614d26e7b6478 (diff)
clover: Dump linked binary to a different file
this allows to pass the generated files directly to llc or bugpoint v2: add atomic counter ID v3: remove extra scope operator, constify Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/llvm/invocation.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index f63ff3d41c3..deebef5726c 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -281,8 +281,12 @@ clover::llvm::link_program(const std::vector<module> &modules,
optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
+ static std::atomic_uint seq(0);
+ const std::string id = "." + mod->getModuleIdentifier() + "-" +
+ std::to_string(seq++);
+
if (has_flag(debug::llvm))
- debug::log(".ll", print_module_bitcode(*mod));
+ debug::log(id + ".ll", print_module_bitcode(*mod));
if (create_library) {
return build_module_library(*mod, module::section::text_library);
@@ -292,7 +296,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(id + ".asm", print_module_native(*mod, target));
return build_module_native(*mod, target, *c, r_log);