[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 28 10:24:53 PDT 2024


================
@@ -6088,6 +6088,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
   StringRef Prefix =
       llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch());
   if (!Prefix.empty()) {
+    if (Prefix == "spv" &&
+        getTarget().getTriple().getOS() == llvm::Triple::OSType::AMDHSA)
+      Prefix = "amdgcn";
----------------
AlexVlx wrote:

I don't think we can, with the current signature of that interface / the current approach of keeping `spirv64` as the prefix, since we need at least the OS type as well to disambiguate. So it'd require either overloading that interface, or using a different prefix (this'd ripple elsewhere).

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


More information about the cfe-commits mailing list