[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

Damyan Pepper via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 5 14:15:57 PDT 2024


================
@@ -2474,7 +2474,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
     // If we don't have a declaration to control inlining, the function isn't
     // explicitly marked as alwaysinline for semantic reasons, and inlining is
     // disabled, mark the function as noinline.
+    // HLSL functions must be always inlined
     if (!F->hasFnAttribute(llvm::Attribute::AlwaysInline) &&
+        !getLangOpts().HLSL &&
----------------
damyanp wrote:

A bit lower down there's some similar checks that seem to involve `AlwaysInline` and `OnlyAlwaysInlining` (around line 2536).  Does this also need to be updated for HLSL mode?

https://github.com/llvm/llvm-project/pull/106588


More information about the cfe-commits mailing list