[clang] [llvm] [AMDGPU] Add OpenCL-specific fence address space masks (PR #78572)
Sameer Sahasrabuddhe via cfe-commits
cfe-commits at lists.llvm.org
Fri May 3 00:23:20 PDT 2024
================
@@ -18365,6 +18366,30 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
return nullptr;
}
+void CodeGenFunction::AddAMDGCNAddressSpaceMMRA(llvm::Instruction *Inst,
+ const CallExpr *E,
+ unsigned FirstASNameIdx) {
+ constexpr const char *Tag = "opencl-fence-mem";
+
+ LLVMContext &Ctx = Inst->getContext();
+ SmallVector<MMRAMetadata::TagT, 3> MMRAs;
+ for (unsigned K = FirstASNameIdx; K < E->getNumArgs(); ++K) {
+ llvm::Value *V = EmitScalarExpr(E->getArg(K));
+ StringRef AS;
+ if (llvm::getConstantStringInfo(V, AS) &&
+ (AS == "local" || AS == "global" || AS == "image")) {
----------------
ssahasra wrote:
Can these magic strings be declared somewhere? Ideally some sort of target-specific mechanism that Clang will use to find such sets of valid strings?
https://github.com/llvm/llvm-project/pull/78572
More information about the cfe-commits
mailing list