[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 09:59:39 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 quite see any other point to tweak the logic. We have some `amdgcn` builtins that get handled here, as opposed to via `EmitTargetBuiltinExpr`, and this is the narrowest scope for adjusting `Prefix`; the information that this is coming from AMDGCN flavoured SPIRV is lost past this point. Did you have something in mind regarding where to handle this as an alternative?

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


More information about the cfe-commits mailing list