[all-commits] [llvm/llvm-project] 3ab301: [CodeGen] only add nobuiltin to inline builtins if...

George Burgess IV via All-commits all-commits at lists.llvm.org
Thu May 7 13:49:08 PDT 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ab301b4d9700d7ce3ebc22750166c49b45e3e98
      https://github.com/llvm/llvm-project/commit/3ab301b4d9700d7ce3ebc22750166c49b45e3e98
  Author: George Burgess IV <george.burgess.iv at gmail.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c

  Log Message:
  -----------
  [CodeGen] only add nobuiltin to inline builtins if we'll emit them

There are some inline builtin definitions that we can't emit
(isTriviallyRecursive & callers go into why). Marking these
nobuiltin is only useful if we actually emit the body, so don't mark
these as such unless we _do_ plan on emitting that.

This suboptimality was encountered in Linux (see some discussion on
D71082, and https://github.com/ClangBuiltLinux/linux/issues/979).

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

(cherry picked from commit 2dd17ff08165e6118e70f00e22b2c36d2d4e0a9a)


  Commit: eaae6dfc545000e335e6f89abb9c78818383d7ad
      https://github.com/llvm/llvm-project/commit/eaae6dfc545000e335e6f89abb9c78818383d7ad
  Author: George Burgess IV <george.burgess.iv at gmail.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.cpp

  Log Message:
  -----------
  [CodeGen] fix inline builtin-related breakage from D78162

In cases where we have multiple decls of an inline builtin, we may need
to go hunting for the one with a definition when setting function
attributes.

An additional test-case was provided on
https://github.com/ClangBuiltLinux/linux/issues/979

(cherry picked from commit 94908088a831141cfbdd15fc5837dccf30cfeeb6)


Compare: https://github.com/llvm/llvm-project/compare/f082d9180164...eaae6dfc5450


More information about the All-commits mailing list