[all-commits] [llvm/llvm-project] 3999dc: [Inline] prevent inlining on noprofile mismatch

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Tue Jun 29 10:43:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3999dcae5e763adceb2c3bc1dbc8f2c005c808ef
      https://github.com/llvm/llvm-project/commit/3999dcae5e763adceb2c3bc1dbc8f2c005c808ef
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/IR/Attributes.td
    A llvm/test/Transforms/Inline/inline_noprofile.ll

  Log Message:
  -----------
  [Inline] prevent inlining on noprofile mismatch

Similar to
commit bc044a88ee3c ("[Inline] prevent inlining on stack protector mismatch")

The noprofile function attribute is meant to prevent compiler
instrumentation from being inserted into a function. Inlining may defeat
the developer's intent. If the caller and callee don't either BOTH have
the attribute or BOTH lack the attribute, suppress inline substitution.

This matches behavior being proposed in GCC:
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573511.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223

Add LangRef entry for noprofile fn attr, similar to text added in D93422
and D104944.

Reviewed By: MaskRay, melver, phosek

Differential Revision: https://reviews.llvm.org/D104810




More information about the All-commits mailing list