================ @@ -414,9 +414,20 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, void CGHLSLRuntime::setHLSLFunctionAttributes(const FunctionDecl *FD, llvm::Function *Fn) { - if (FD->isInExportDeclContext()) { - const StringRef ExportAttrKindStr = "hlsl.export"; - Fn->addFnAttr(ExportAttrKindStr); + if (FD) { // "explicit" functions with declarations + if (FD->isInExportDeclContext()) { + const StringRef ExportAttrKindStr = "hlsl.export"; + Fn->addFnAttr(ExportAttrKindStr); + } + // Respect noinline if the explicit functions use it + // otherwise default to alwaysinline + if (!Fn->hasFnAttribute(Attribute::NoInline)) + Fn->addFnAttr(llvm::Attribute::AlwaysInline); + } else { // "implicit" autogenerated functions with no declaration + // Implicit functions might get marked as noinline by default + // but we override that for HLSL + Fn->removeFnAttr(Attribute::NoInline); ---------------- llvm-beanz wrote:
Which auto-generated functions are getting noinline attached to them? Do you know where that is happening? https://github.com/llvm/llvm-project/pull/106588 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits