[all-commits] [llvm/llvm-project] bed5ee: [clang] NFC: Enhance comments in CodeGen for multi...

Tom Honermann via All-commits all-commits at lists.llvm.org
Tue Apr 5 16:50:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bed5ee3f4ba2406658760ec4029ed222c6213ff7
      https://github.com/llvm/llvm-project/commit/bed5ee3f4ba2406658760ec4029ed222c6213ff7
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h

  Log Message:
  -----------
  [clang] NFC: Enhance comments in CodeGen for multiversion function support.

Reviewed By: erichkeane

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


  Commit: 0ace0100aec31bdff7e856df806cca18d8faabd7
      https://github.com/llvm/llvm-project/commit/0ace0100aec31bdff7e856df806cca18d8faabd7
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h

  Log Message:
  -----------
  [clang] NFC: Simplify the interface to CodeGenModule::GetOrCreateMultiVersionResolver().

Previously, GetOrCreateMultiVersionResolver() required the caller to provide
a GlobalDecl along with an llvm::type and FunctionDecl. The latter two can be
cheaply obtained from the first, and the llvm::type parameter is not always
used, so requiring the caller to provide them was unnecessary and created the
possibility that callers would pass an inconsistent set. This change simplifies
the interface to only require the GlobalDecl value.

Reviewed By: erichkeane

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


  Commit: 40af8df6fe642749f9ac5486822c2bd5cc587ab7
      https://github.com/llvm/llvm-project/commit/40af8df6fe642749f9ac5486822c2bd5cc587ab7
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp

  Log Message:
  -----------
  [clang] NFC: Preparation for merging code to emit target and target_clones resolvers.

This change modifies CodeGenModule::emitMultiVersionFunctions() in preparation
for a change that will merge support for emitting target_clones resolvers into
this function. This change mostly serves to isolate indentation changes from
later behavior modifying changes.

Reviewed By: erichkeane

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


  Commit: 5531abaf7158652bf7411937781780e9f6358ecf
      https://github.com/llvm/llvm-project/commit/5531abaf7158652bf7411937781780e9f6358ecf
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/test/CodeGen/attr-target-clones.c
    M clang/test/CodeGenCXX/attr-target-clones.cpp

  Log Message:
  -----------
  [clang] Corrections for target_clones multiversion functions.

This change merges code for emit of target and target_clones multiversion
resolver functions and, in doing so, corrects handling of target_clones
functions that are declared but not defined. Previously, a use of such
a target_clones function would result in an attempted emit of an ifunc
that referenced an undefined resolver function. Ifunc references to
undefined resolver functions are not allowed and, when the LLVM verifier
is not disabled (via '-disable-llvm-verifier'), resulted in the verifier
issuing a "IFunc resolver must be a definition" error and aborting the
compilation. With this change, ifuncs and resolver function definitions
are always emitted for used target_clones functions regardless of whether
the target_clones function is defined (if the function is defined, then
the ifunc and resolver are emitted regardless of whether the function is
used).

This change has the side effect of causing target_clones variants and
resolver functions to be emitted in a different order than they were
previously. This is harmless and is reflected in the updated tests.

Reviewed By: erichkeane

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


Compare: https://github.com/llvm/llvm-project/compare/6720bc202ae5...5531abaf7158


More information about the All-commits mailing list