clover/spirv: Print linked SPIR-V module if asked

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>
This commit is contained in:
Pierre Moreau 2020-05-05 13:14:26 +02:00 committed by Marge Bot
parent a9ca73730e
commit ec6bad140b

View 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());