[all-commits] [llvm/llvm-project] c1779f: [flang] Implement !DIR$ [NO]INLINE and FORCEINLINE...

Jean-Didier PAILLEUX via All-commits all-commits at lists.llvm.org
Tue Oct 28 00:02:37 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1779f33bdada6e478e882cc23a647ef9abaad96
      https://github.com/llvm/llvm-project/commit/c1779f33bdada6e478e882cc23a647ef9abaad96
  Author: Jean-Didier PAILLEUX <jean-didier.pailleux at sipearl.com>
  Date:   2025-10-28 (Tue, 28 Oct 2025)

  Changed paths:
    M flang/docs/Directives.md
    M flang/include/flang/Evaluate/call.h
    M flang/include/flang/Optimizer/Dialect/FIRAttr.td
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/Transforms/PolymorphicOpConversion.cpp
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Semantics/canonicalize-directives.cpp
    M flang/lib/Semantics/resolve-names.cpp
    A flang/test/Integration/inline_directive.f90
    A flang/test/Lower/inline_directive.f90
    M flang/test/Parser/compiler-directives.f90

  Log Message:
  -----------
  [flang] Implement !DIR$ [NO]INLINE and FORCEINLINE directives (#134350)

This patch adds the support of these two directives : `!dir$ inline` and
`!dir$ noinline`.
- `!dir$ noinline` tells to the compiler to not perform inlining on
specific function calls by adding the `noinline` metadata on the call.
- `!dir$ inline` tells to the compiler to attempt inlining on specific
function calls by adding the `inlinehint` metadata on the call.
- `!dir$ forceinline` tells to the compiler to always perfom inlining on
specific function calls by adding the `alwaysinline` metadata on the
call.

Currently, these directives can be placed before a `DO LOOP`, call
functions or assignments. Maybe other statements can be added in the
future if needed.

For the `inline` directive the correct name might be `forceinline` but
I'm not sure ?



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