================
@@ -6138,6 +6150,17 @@ void
CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD,
CodeGenFunction(*this).GenerateCode(GD, Fn, FI);
setNonAliasAttributes(GD, Fn);
+
+ if (D->hasAttr<OpenCLKernelAttr>()) {
+ if (GD.getKernelReferenceKind() == KernelReferenceKind::Stub) {
+ if (Fn->hasFnAttribute(llvm::Attribute::NoInline))
+ Fn->removeFnAttr(llvm::Attribute::NoInline);
+ if (Fn->hasFnAttribute(llvm::Attribute::InlineHint))
+ Fn->removeFnAttr(llvm::Attribute::InlineHint);
+ Fn->addFnAttr(llvm::Attribute::AlwaysInline);
+ }
+ }
----------------
lalaniket8 wrote:
I see, yes it seems that adding the alwaysinline attribute is not necessary. I
have removed it in the latest commit and made required changes in the test
files.
https://github.com/llvm/llvm-project/pull/115821
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits