================ @@ -193,6 +194,33 @@ void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA, Lld, LldArgs, Inputs, Output)); } +// For SPIR-V the inputs for the job are device AMDGCN SPIR-V flavoured bitcode +// and the output is either a compiled SPIR-V binary or bitcode (-emit-llvm). It +// calls llvm-link and then the llvm-spirv translator. Once the SPIR-V BE will +// be promoted from experimental, we will switch to using that. TODO: consider +// if we want to run any targeted optimisations over IR here, over generic +// SPIR-V. +void AMDGCN::Linker::constructLinkAndEmitSpirvCommand( + Compilation &C, const JobAction &JA, const InputInfoList &Inputs, + const InputInfo &Output, const llvm::opt::ArgList &Args) const { + assert(!Inputs.empty() && "Must have at least one input."); + + constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + + // Linked BC is now in Output + + // Emit SPIR-V binary. + llvm::opt::ArgStringList TrArgs{ + "--spirv-max-version=1.6", + "--spirv-ext=+all", + "--spirv-allow-extra-diexpressions", ---------------- MrSidims wrote:
@AlexVlx nit: if generation of NonSemantic.Shader.DebugInfo.200 is turned on - this option is not needed as the extended instruction already adds all DWARF expressions (including LLVM-specific expressions). https://github.com/llvm/llvm-project/pull/95061 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits