[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 9 16:51:13 PDT 2024
================
@@ -2502,9 +2505,12 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
ShouldAddOptNone &= !D->hasAttr<MinSizeAttr>();
ShouldAddOptNone &= !D->hasAttr<AlwaysInlineAttr>();
- // Add optnone, but do so only if the function isn't always_inline.
- if ((ShouldAddOptNone || D->hasAttr<OptimizeNoneAttr>()) &&
- !F->hasFnAttribute(llvm::Attribute::AlwaysInline)) {
+ // alwaysinline all HLSL functions save entry points
----------------
llvm-beanz wrote:
nit:
```suggestion
// Add alwaysinline on all HLSL functions except entry points.
```
https://github.com/llvm/llvm-project/pull/106588
More information about the cfe-commits
mailing list