================
@@ -147,6 +147,14 @@ getNVIDIAOffloadTargetTriple(const Driver &D, const 
ArgList &Args,
 static std::optional<llvm::Triple>
 getHIPOffloadTargetTriple(const Driver &D, const ArgList &Args) {
   if (!Args.hasArg(options::OPT_offload_EQ)) {
+    auto OffloadArchs = Args.getAllArgValues(options::OPT_offload_arch_EQ);
+    if (llvm::find(OffloadArchs, "amdgcnspirv") != OffloadArchs.cend()) {
+      if (OffloadArchs.size() == 1)
+        return llvm::Triple("spirv64-amd-amdhsa");
----------------
yxsamliu wrote:

Use a toolchain with spirv64 as triple will cause trouble for us to support 
mixed amdgcn and spirv fat binaries, which is critical for us.

Better to take the approach similar to 
https://github.com/llvm/llvm-project/pull/75357, i.e. treat spirv as a 
processor of amgcn triple, so that we can use HIPAMD toolchain for both spirv 
and real amdgcn processor.

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

Reply via email to