[clang] ae91953 - clang: Remove HLSL checks for a preexisting noinline (#245857)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 07:48:41 PST 2026


Author: Matt Arsenault
Date: 2026-12-04T15:48:35Z
New Revision: ae91953bdafa358c13526fa462fa5a390fb7b7e5

URL: https://github.com/llvm/llvm-project/commit/ae91953bdafa358c13526fa462fa5a390fb7b7e5
DIFF: https://github.com/llvm/llvm-project/commit/ae91953bdafa358c13526fa462fa5a390fb7b7e5.diff

LOG: clang: Remove HLSL checks for a preexisting noinline (#245857)

SetLLVMFunctionAttributesForDefinition only adds alwaysinline to
functions that are not already noinline. Nothing marks these functions
noinline before this point. The HLSL entry functions are marked
noinline, but they are created separately and never reach here.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 5941881fb67d7..9ca85831a71b6 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3263,7 +3263,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(GlobalDecl GD,
 
   if (!D) {
     // Non-entry HLSL functions must always be inlined.
-    if (getLangOpts().HLSL && !F->hasFnAttribute(llvm::Attribute::NoInline))
+    if (getLangOpts().HLSL)
       B.addAttribute(llvm::Attribute::AlwaysInline);
     // If we don't have a declaration to control inlining, the function isn't
     // explicitly marked as alwaysinline for semantic reasons, and inlining is
@@ -3312,8 +3312,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(GlobalDecl GD,
   ShouldAddOptNone &= !D->hasAttr<AlwaysInlineAttr>();
 
   // Non-entry HLSL functions must always be inlined.
-  if (getLangOpts().HLSL && !F->hasFnAttribute(llvm::Attribute::NoInline) &&
-      !D->hasAttr<NoInlineAttr>()) {
+  if (getLangOpts().HLSL && !D->hasAttr<NoInlineAttr>()) {
     B.addAttribute(llvm::Attribute::AlwaysInline);
   } else if ((ShouldAddOptNone || D->hasAttr<OptimizeNoneAttr>()) &&
              !AlwaysInline) {


        


More information about the cfe-commits mailing list