[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 14 07:27:54 PST 2023


================
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   if (JA.getType() == types::TY_LLVM_BC)
     return constructLlvmLinkCommand(C, JA, Inputs, Output, Args);
 
+  if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") {
+    llvm::opt::ArgStringList TrArgs{"--spirv-max-version=1.1",
----------------
yxsamliu wrote:

> I wonder if `-mcpu` is the correct way to encode this. Targeting SPIR-V is more like the triple than the architecture as far as I'm aware.

I will see whether I can use triple instead.

https://github.com/llvm/llvm-project/pull/75357


More information about the cfe-commits mailing list