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

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 07:06:01 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've fixed the `"spv"` exclusion. Circling back to the idea of moving the prefix into `TargetInfo`, that seems like a pretty nice improvement - I think we could also deal with scenarios like the one here where there's an union of target specific builtins (spv & amdgcn in this case) by having some sort of parent-child / main-aux relationship. It should probably be a separate PR since it's an independent piece of functionality (and I've not thought through it fully yet) - unless you disagree?

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


More information about the llvm-commits mailing list