[all-commits] [llvm/llvm-project] a729e7: [HLSL] set alwaysinline on HLSL functions (#106588)

Greg Roth via All-commits all-commits at lists.llvm.org
Tue Sep 17 10:10:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a729e706de3fc6ebee49ede3c50afb47f2e29191
      https://github.com/llvm/llvm-project/commit/a729e706de3fc6ebee49ede3c50afb47f2e29191
  Author: Greg Roth <grroth at microsoft.com>
  Date:   2024-09-17 (Tue, 17 Sep 2024)

  Changed paths:
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl
    M clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl
    M clang/test/CodeGenHLSL/GlobalDestructors.hlsl
    M clang/test/CodeGenHLSL/builtins/RWBuffer-constructor.hlsl
    M clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl
    A clang/test/CodeGenHLSL/inline-constructors.hlsl
    A clang/test/CodeGenHLSL/inline-functions.hlsl

  Log Message:
  -----------
  [HLSL] set alwaysinline on HLSL functions (#106588)

HLSL inlines all its functions by default. This uses the alwaysinline
attribute to make the alwaysinliner pass inline any function not
explicitly marked noinline by the user or autogeneration. The
alwayslinline marking takes place in `SetLLVMFunctionAttributesForDefinitions`
where all other inlining interactions are determined.

The outermost entry function is marked noinline because there's no
reason to inline it. Any user calls to an entry function will instead call
the internal mangled version of the entry function.

Adds tests for function and constructor inlining and augments some
existing tests to verify correct inlining of implicitly created
functions as well.

Incidentally restore RUN line that I believe was mistakenly removed as
part of #88918

Fixes #89282



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list