[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)
Greg Roth via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 10 12:59:41 PDT 2024
================
@@ -2471,11 +2471,14 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
B.addAttribute(llvm::Attribute::StackProtectReq);
if (!D) {
+ // HLSL functions must always be inlined
+ if (getLangOpts().HLSL && !F->hasFnAttribute("hlsl.shader"))
----------------
pow2clk wrote:
Just an update. As a result of the waning minutes of a design discussion, we resolved to produce a warning when users apply noinline and explicitly set noinline for the outermost entry function which would allow checking for that in place of hlsl.shader here, which might allow graceful resolution of any other functions that happen to get it applied here which we could have an assert for.
https://github.com/llvm/llvm-project/pull/106588
More information about the cfe-commits
mailing list