[all-commits] [llvm/llvm-project] 9deab6: Implement target_clones multiversioning

Erich Keane via All-commits all-commits at lists.llvm.org
Thu Nov 11 11:11:40 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9deab60ae710f8c4cc810cd680edfb64c803f42d
      https://github.com/llvm/llvm-project/commit/9deab60ae710f8c4cc810cd680edfb64c803f42d
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2021-11-11 (Thu, 11 Nov 2021)

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/attr-target-clones.c
    A clang/test/CodeGenCXX/attr-target-clones.cpp
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    M clang/test/Sema/attr-cpuspecific.c
    A clang/test/Sema/attr-target-clones.c
    A clang/test/SemaCXX/attr-target-clones.cpp

  Log Message:
  -----------
  Implement target_clones multiversioning

As discussed here: https://lwn.net/Articles/691932/

GCC6.0 adds target_clones multiversioning. This functionality is
an odd cross between the cpu_dispatch and 'target' MV, but is compatible
with neither.

This attribute allows you to list all options, then emits a separately
optimized version of each function per-option (similar to the
cpu_specific attribute). It automatically generates a resolver, just
like the other two.

The mangling however, is... ODD to say the least. The mangling format
is:
<normal_mangling>.<option string>.<option ordinal>.

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




More information about the All-commits mailing list