clover/spirv: Print linked SPIR-V module if asked
authorPierre Moreau <dev@pmoreau.org>
Tue, 5 May 2020 11:14:26 +0000 (13:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 19:48:12 +0000 (19:48 +0000)
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Serge Martin <edb@sigluy.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5038>

src/gallium/frontends/clover/spirv/invocation.cpp

index 2adfc668f99e9c3019a94bc2b11646b76d9181d3..e4b1565288fbd4b0829e9a77878f48b1edaca8be 100644 (file)
@@ -654,6 +654,9 @@ clover::spirv::link_program(const std::vector<module> &modules,
    if (!is_valid_spirv(final_binary, opencl_version, r_log))
       throw error(CL_LINK_PROGRAM_FAILURE);
 
+   if (has_flag(llvm::debug::spirv))
+      llvm::debug::log(".spvasm", spirv::print_module(final_binary, dev.device_version()));
+
    for (const auto &mod : modules)
       m.syms.insert(m.syms.end(), mod.syms.begin(), mod.syms.end());