================
@@ -384,6 +384,28 @@ static Value *buildVectorInput(IRBuilder<> &B, Function 
*F, llvm::Type *Ty) {
   return B.CreateCall(F, {B.getInt32(0)});
 }
 
+static void addBuiltinDecoration(llvm::GlobalVariable *GV, unsigned BuiltIn) {
+  LLVMContext &Ctx = GV->getContext();
+  IRBuilder<> B(GV->getContext());
+  MDNode *Operands =
+      MDNode::get(Ctx, {ConstantAsMetadata::get(B.getInt32(11)),
+                        ConstantAsMetadata::get(B.getInt32(BuiltIn))});
+  MDNode *Decoration = MDNode::get(Ctx, {Operands});
+  GV->addMetadata("spirv.Decorations", *Decoration);
----------------
farzonl wrote:

hmm should this metadata be guarded with a conditional for the spirv target?

https://github.com/llvm/llvm-project/pull/141759
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to